summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/telnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/telnet.c')
-rw-r--r--libs/libcurl/src/telnet.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/libs/libcurl/src/telnet.c b/libs/libcurl/src/telnet.c
index 622850f052..f57addbefe 100644
--- a/libs/libcurl/src/telnet.c
+++ b/libs/libcurl/src/telnet.c
@@ -190,6 +190,7 @@ const struct Curl_handler Curl_handler_telnet = {
ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
+ ZERO_NULL, /* follow */
PORT_TELNET, /* defport */
CURLPROTO_TELNET, /* protocol */
CURLPROTO_TELNET, /* family */
@@ -695,7 +696,10 @@ static void printsub(struct Curl_easy *data,
infof(data, ", not IAC SE) ");
}
}
- length -= 2;
+ if(length >= 2)
+ length -= 2;
+ else /* bad input */
+ return;
}
if(length < 1) {
infof(data, "(Empty suboption?)");
@@ -773,23 +777,15 @@ static void printsub(struct Curl_easy *data,
}
}
-#ifdef _MSC_VER
-#pragma warning(push)
-/* warning C4706: assignment within conditional expression */
-#pragma warning(disable:4706)
-#endif
static bool str_is_nonascii(const char *str)
{
char c;
- while((c = *str++))
+ while((c = *str++) != 0)
if(c & 0x80)
return TRUE;
return FALSE;
}
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
static CURLcode check_telnet_options(struct Curl_easy *data)
{
@@ -1556,10 +1552,9 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done)
/* returned not-zero, this an error */
if(result) {
keepon = FALSE;
- /* TODO: in test 1452, macOS sees a ECONNRESET sometimes?
- * Is this the telnet test server not shutting down the socket
- * in a clean way? Seems to be timing related, happens more
- * on slow debug build */
+ /* In test 1452, macOS sees a ECONNRESET sometimes? Is this the
+ * telnet test server not shutting down the socket in a clean way?
+ * Seems to be timing related, happens more on slow debug build */
if(data->state.os_errno == ECONNRESET) {
DEBUGF(infof(data, "telnet_do, unexpected ECONNRESET on recv"));
}