aboutsummaryrefslogtreecommitdiff
path: root/lib/vauth/ntlm_sspi.c
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2017-09-02 12:49:59 +0100
committerPatrick Monnerat <patrick@monnerat.net>2017-09-02 12:49:59 +0100
commit6869d65f548b264725218f21cdf6443d26938e6f (patch)
treea588e621ab086d5290a66510f012622bd0202ac3 /lib/vauth/ntlm_sspi.c
parent70231d6a6551ab89ea2801df661fc1cd17967ba7 (diff)
Curl_base64_encode: always call with a real data handle.
Some calls in different modules were setting the data handle to NULL, causing segmentation faults when using builds that enable character code conversions.
Diffstat (limited to 'lib/vauth/ntlm_sspi.c')
-rw-r--r--lib/vauth/ntlm_sspi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c
index c3305176d..f99325710 100644
--- a/lib/vauth/ntlm_sspi.c
+++ b/lib/vauth/ntlm_sspi.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -66,6 +66,7 @@ bool Curl_auth_is_ntlm_supported(void)
*
* Parameters:
*
+ * data [in] - The session handle.
* userp [in] - The user name in the format User or Domain\User.
* passdwp [in] - The user's password.
* ntlm [in/out] - The NTLM data struct being used and modified.
@@ -75,7 +76,8 @@ bool Curl_auth_is_ntlm_supported(void)
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
+CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data,
+ const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
char **outptr, size_t *outlen)
@@ -166,7 +168,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
return CURLE_RECV_ERROR;
/* Base64 encode the response */
- return Curl_base64_encode(NULL, (char *) ntlm->output_token,
+ return Curl_base64_encode(data, (char *) ntlm->output_token,
type_1_buf.cbBuffer, outptr, outlen);
}