From: Daniel Stenberg Date: Mon, 6 Oct 2025 21:05:10 +0000 (+0200) Subject: telnet: ignore empty suboptions X-Git-Tag: rc-8_17_0-1~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33380fa214d6ff9a0c1dc29b61aa6650b4ed3fa7;p=thirdparty%2Fcurl.git telnet: ignore empty suboptions To avoid printing from en empty buffer Reported-by: Joshua Rogers Closes #18899 --- diff --git a/lib/telnet.c b/lib/telnet.c index 6eb60706c9..5c25bc2eaa 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -947,6 +947,9 @@ static CURLcode suboption(struct Curl_easy *data, struct TELNET *tn) int err; struct connectdata *conn = data->conn; + if(!CURL_SB_LEN(tn)) /* ignore empty suboption */ + return CURLE_OK; + printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn) + 2); switch(CURL_SB_GET(tn)) { case CURL_TELOPT_TTYPE: