diff options
author | Nathan Moinvaziri <nathan@nathanm.com> | 2022-11-11 16:42:18 -0800 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-11-13 22:42:01 +0100 |
commit | 5f8351aea3b04e9692e0e256806eb968ad4d042b (patch) | |
tree | 72cd15c5dfb69cbc9ee0eac05dc454bc0c0d9231 /lib/curl_ntlm_core.c | |
parent | 1ec3f449fb738b18eda2f64764b193bbbf2ba7e1 (diff) | |
download | curl-5f8351aea3b04e9692e0e256806eb968ad4d042b.tar.gz |
ntlm: silence ubsan warning about copying from null target_info pointer.
runtime error: null pointer passed as argument 2, which is declared to
never be null
Closes #9898
Diffstat (limited to 'lib/curl_ntlm_core.c')
-rw-r--r-- | lib/curl_ntlm_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index 38e193c18..461c009d2 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -658,7 +658,8 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, LONGQUARTET(tw.dwLowDateTime), LONGQUARTET(tw.dwHighDateTime)); memcpy(ptr + 32, challenge_client, 8); - memcpy(ptr + 44, ntlm->target_info, ntlm->target_info_len); + if(ntlm->target_info_len) + memcpy(ptr + 44, ntlm->target_info, ntlm->target_info_len); /* Concatenate the Type 2 challenge with the BLOB and do HMAC MD5 */ memcpy(ptr + 8, &ntlm->nonce[0], 8); |