From: Max Khon Date: Wed, 28 Dec 2016 12:10:59 +0000 (+0600) Subject: digest_sspi: copy terminating NUL as well X-Git-Tag: curl-7_53_0~134 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89b789884680134d5090c6de2e6b621e908b1902;p=thirdparty%2Fcurl.git digest_sspi: copy terminating NUL as well Curl_auth_decode_digest_http_message(): copy terminating NUL as later Curl_override_sspi_http_realm() expects a NUL-terminated string. Fixes #1180 --- diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index b9ceb12a99..6f0746fc44 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -341,7 +341,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, return CURLE_BAD_CONTENT_ENCODING; /* Simply store the challenge for use later */ - digest->input_token = (BYTE *) Curl_memdup(chlg, chlglen); + digest->input_token = (BYTE *) Curl_memdup(chlg, chlglen + 1); if(!digest->input_token) return CURLE_OUT_OF_MEMORY;