From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:15:56 +0000 (+0000) Subject: negotiate_sspi_auth: Fix command debugging (-v) (#2025) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=65ad598418b11f81ca655fa425cffe34a77e69b9;p=thirdparty%2Fsquid.git negotiate_sspi_auth: Fix command debugging (-v) (#2025) Terminate helper_command buffer before using it as a c-string. Supported helper commands have two characters. This change also reduces MinGW build errors. --- diff --git a/src/auth/negotiate/SSPI/negotiate_sspi_auth.cc b/src/auth/negotiate/SSPI/negotiate_sspi_auth.cc index 860a6c8901..6a257ae14f 100644 --- a/src/auth/negotiate/SSPI/negotiate_sspi_auth.cc +++ b/src/auth/negotiate/SSPI/negotiate_sspi_auth.cc @@ -168,7 +168,7 @@ manage_request() if ((strlen(buf) > 3) && Negotiate_packet_debug_enabled) { if (!token_decode(&decodedLen, decoded, buf+3)) return 1; - strncpy(helper_command, buf, 2); + xstrncpy(helper_command, buf, sizeof(helper_command)); debug("Got '%s' from Squid with data:\n", helper_command); hex_dump(reinterpret_cast(decoded), decodedLen); } else