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>
(cherry picked from commit 022409e99c)
This commit is contained in:
Andreas Schneider
2020-01-23 10:20:59 +01:00
parent 6fcd0940e3
commit 9a10cef920

View File

@@ -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) {