diff options
author | rofl0r <retnyg@gmx.net> | 2011-08-29 21:07:20 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-29 21:48:09 +0200 |
commit | 730da3e3c2532a33344fd3f646c9a97ed2caada9 (patch) | |
tree | f435bb68ae8a11d359863845739918214f82c033 /src | |
parent | 661722753b83d0d8eff08a1572a3468b6d30183e (diff) | |
download | libssh-730da3e3c2532a33344fd3f646c9a97ed2caada9.tar.gz libssh-730da3e3c2532a33344fd3f646c9a97ed2caada9.tar.xz libssh-730da3e3c2532a33344fd3f646c9a97ed2caada9.zip |
channels: Fix possible infinite loop in channel_read().
(cherry picked from commit 66188f1af84852b9d9fc09acf26454c4cfacefef)
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c index ca730868..23376ac3 100644 --- a/src/channels.c +++ b/src/channels.c @@ -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_buffer stdbuf = channel->stdout_buffer; uint32_t len; + int rc; enter_function(); @@ -2398,7 +2399,10 @@ int ssh_channel_read(ssh_channel channel, void *dest, uint32_t count, int is_std break; } - ssh_handle_packets(session, -2); + rc = ssh_handle_packets(session, -2); + if (rc != SSH_OK) { + return rc; + } } len = buffer_get_rest_len(stdbuf); |