mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
channels: Fix possible infinite loop in channel_read().
(cherry picked from commit 66188f1af8)
This commit is contained in:
committed by
Andreas Schneider
parent
661722753b
commit
730da3e3c2
@@ -2350,6 +2350,7 @@ int ssh_channel_read(ssh_channel channel, void *dest, uint32_t count, int is_std
|
|||||||
ssh_session session = channel->session;
|
ssh_session session = channel->session;
|
||||||
ssh_buffer stdbuf = channel->stdout_buffer;
|
ssh_buffer stdbuf = channel->stdout_buffer;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
int rc;
|
||||||
|
|
||||||
enter_function();
|
enter_function();
|
||||||
|
|
||||||
@@ -2398,7 +2399,10 @@ int ssh_channel_read(ssh_channel channel, void *dest, uint32_t count, int is_std
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_handle_packets(session, -2);
|
rc = ssh_handle_packets(session, -2);
|
||||||
|
if (rc != SSH_OK) {
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
len = buffer_get_rest_len(stdbuf);
|
len = buffer_get_rest_len(stdbuf);
|
||||||
|
|||||||
Reference in New Issue
Block a user