aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_ntlm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/curl_ntlm.c')
-rw-r--r--lib/curl_ntlm.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/curl_ntlm.c b/lib/curl_ntlm.c
index c0289e5d4..b555f5ab6 100644
--- a/lib/curl_ntlm.c
+++ b/lib/curl_ntlm.c
@@ -305,16 +305,22 @@ CURLcode Curl_ntlm_decode_type2_message(struct SessionHandle *data,
(*) -> Optional
*/
- size_t size;
- unsigned char *buffer;
+ size_t size = 0;
+ unsigned char *buffer = NULL;
+ CURLcode error;
#if defined(CURL_DISABLE_VERBOSE_STRINGS) || defined(USE_WINDOWS_SSPI)
(void)data;
#endif
- size = Curl_base64_decode(header, &buffer);
- if(!buffer)
- return CURLE_OUT_OF_MEMORY;
+ error = Curl_base64_decode(header, &buffer, &size);
+ if(error)
+ return error;
+
+ if(!buffer) {
+ infof(data, "NTLM handshake failure (unhandled condition)\n");
+ return CURLE_REMOTE_ACCESS_DENIED;
+ }
#ifdef USE_WINDOWS_SSPI
ntlm->type_2 = malloc(size + 1);