1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-01 11:01:39 +03:00

scp: Fix potential infinite loop in ssh_scp_close

Signed-off-by: Mark Riordan <mriordan@ipswitch.com>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Mark Riordan
2011-04-08 09:50:32 -05:00
committed by Andreas Schneider
parent 3e7d4534ce
commit 5939cfe78a

View File

@ -148,7 +148,7 @@ int ssh_scp_close(ssh_scp scp){
*/ */
while(!ssh_channel_is_eof(scp->channel)){ while(!ssh_channel_is_eof(scp->channel)){
err=ssh_channel_read(scp->channel,buffer,sizeof(buffer),0); err=ssh_channel_read(scp->channel,buffer,sizeof(buffer),0);
if(err==SSH_ERROR) if(err==SSH_ERROR || err==0)
break; break;
} }
if(ssh_channel_close(scp->channel) == SSH_ERROR){ if(ssh_channel_close(scp->channel) == SSH_ERROR){