From: Marc Hoersken Date: Tue, 24 Feb 2015 23:01:14 +0000 (+0100) Subject: telnet.c: fix invalid use of custom read function if not being set X-Git-Tag: curl-7_41_0~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3bcdaf01a1123bd1b7a8c32f4fc73d145c51d38;p=curl telnet.c: fix invalid use of custom read function if not being set obj_count can be 1 if the custom read function is set or the stdin handle is a reference to a pipe. Since the pipe should be handled using the PeekNamedPipe-check below, the custom read function should only be used if it is actually enabled. --- diff --git a/lib/telnet.c b/lib/telnet.c index 236e59286..6904c4ce3 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1427,7 +1427,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) case WAIT_TIMEOUT: { for(;;) { - if(obj_count == 1) { + if(data->set.is_fread_set) { /* read from user-supplied method */ result = (int) conn->fread_func(buf, 1, BUFSIZE - 1, conn->fread_in); if(result == CURL_READFUNC_ABORT) {