mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-05-14 20:15:08 +03:00
scp: Check return value of ssh_channel_poll.
Found by Coverity.
This commit is contained in:
parent
41269874f5
commit
6acce40a28
@ -419,7 +419,11 @@ int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len){
|
||||
if(scp->processed + len > scp->filelen)
|
||||
len = (size_t) (scp->filelen - scp->processed);
|
||||
/* hack to avoid waiting for window change */
|
||||
ssh_channel_poll(scp->channel,0);
|
||||
r = ssh_channel_poll(scp->channel, 0);
|
||||
if (r == SSH_ERROR) {
|
||||
scp->state = SSH_SCP_ERROR;
|
||||
return SSH_ERROR;
|
||||
}
|
||||
w=ssh_channel_write(scp->channel,buffer,len);
|
||||
if(w != SSH_ERROR)
|
||||
scp->processed += w;
|
||||
|
Loading…
x
Reference in New Issue
Block a user