[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] channels: properly set rc to length
[Thread Prev] | [Thread Next]
[Date Prev] | [Date Next]
- Subject: [PATCH] channels: properly set rc to length
- From: Heiko Thiery <heiko.thiery@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 30 Mar 2020 15:53:09 +0200
- To: libssh@xxxxxxxxxx
- Cc: peter.schneider@xxxxxxxxxxx, asn@xxxxxxxxxxxxxx, mvasko@xxxxxxxxx, Heiko Thiery <heiko.thiery@xxxxxxxxx>
It was observed that in case the returned length of ssh_buffer_get_len was 0 the return value was not properly set to that value. This leads to timeout failures. Signed-off-by: Heiko Thiery <heiko.thiery@xxxxxxxxx> --- src/channels.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/channels.c b/src/channels.c index 20cafeac..ff6465a6 100644 --- a/src/channels.c +++ b/src/channels.c @@ -3118,11 +3118,10 @@ int ssh_channel_poll_timeout(ssh_channel channel, int timeout, int is_stderr) goto out; } len = ssh_buffer_get_len(stdbuf); + rc = (int)len; if (len > 0) { if (len > INT_MAX) { rc = SSH_ERROR; - } else { - rc = (int)len; } goto out; } -- 2.20.1
[RFC] channels regression issue | Heiko Thiery <heiko.thiery@xxxxxxxxx> |