aboutsummaryrefslogtreecommitdiff
path: root/src/channels.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2020-01-23 10:20:59 +0100
committerAndreas Schneider <asn@cryptomilk.org>2020-01-23 10:20:59 +0100
commit022409e99c9f6d6f1e540da5c2fa925b72998974 (patch)
treec02f639af983d301b387020eede2e7af0918c948 /src/channels.c
parent07f571f1c0db615987de462fb709b5d090da2469 (diff)
downloadlibssh-022409e99c9f6d6f1e540da5c2fa925b72998974.tar.gz
libssh-022409e99c9f6d6f1e540da5c2fa925b72998974.tar.xz
libssh-022409e99c9f6d6f1e540da5c2fa925b72998974.zip
channels: Fix ssh_channel_poll_timeout() not returing available bytes
Fixes T211 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Diffstat (limited to 'src/channels.c')
-rw-r--r--src/channels.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/channels.c b/src/channels.c
index a670d895..05dcf8f6 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -3119,6 +3119,11 @@ int ssh_channel_poll_timeout(ssh_channel channel, int timeout, int is_stderr)
}
len = ssh_buffer_get_len(stdbuf);
if (len > 0) {
+ if (len > INT_MAX) {
+ rc = SSH_ERROR;
+ } else {
+ rc = (int)len;
+ }
goto out;
}
if (channel->remote_eof) {