From: Joshua Rogers Date: Sun, 5 Oct 2025 03:07:54 +0000 (+0800) Subject: telnet: print DISPlay LOCation in printsub without mutating buffer X-Git-Tag: rc-8_17_0-3~342 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da8f7ae096bc540dfc53c391b28229c885c31e99;p=thirdparty%2Fcurl.git telnet: print DISPlay LOCation in printsub without mutating buffer Closes #18852 --- diff --git a/lib/telnet.c b/lib/telnet.c index ddc0b22cb6..90316a446c 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -759,8 +759,8 @@ static void printsub(struct Curl_easy *data, switch(pointer[0]) { case CURL_TELOPT_TTYPE: case CURL_TELOPT_XDISPLOC: - pointer[length] = 0; - infof(data, " \"%s\"", &pointer[2]); + infof(data, " \"%.*s\"", + (int)((length > 2) ? (length - 2) : 0), &pointer[2]); break; case CURL_TELOPT_NEW_ENVIRON: if(pointer[1] == CURL_TELQUAL_IS) {