lib: rename Curl_strndup to Curl_memdup0 to avoid misunderstanding

Since the copy does not stop at a null byte, let's not call it anything
that makes you think it works like the common strndup() function.

Based on feedback from Jay Satiro, Stefan Eissing and Patrick Monnerat

Closes #12490
This commit is contained in:
Daniel Stenberg 2023-12-08 14:27:29 +01:00
parent 6d8dc2f636
commit 7c992dd9f8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
15 changed files with 27 additions and 27 deletions

View file

@ -214,7 +214,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
}
/* Store the challenge for later use */
ntlm->input_token = Curl_strndup((const char *)Curl_bufref_ptr(type2),
ntlm->input_token = Curl_memdup0((const char *)Curl_bufref_ptr(type2),
Curl_bufref_len(type2));
if(!ntlm->input_token)
return CURLE_OUT_OF_MEMORY;