aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-02-12 22:20:44 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-02-12 22:20:44 +0000
commite6c1e773d9e506ead2a9fd5fc0f31dceca5e2784 (patch)
tree374b957d30d8186ea36fc3a2ada759928c9dacfa
parent52281a10aad8937cdaf5ccd0cbf13b54617076de (diff)
sasl: Fixed null pointer reference when decoding empty digest challenge
Fixed a null pointer reference when an empty challenge is passed to the Curl_sasl_create_digest_md5_message() function. Bug: http://sourceforge.net/p/curl/bugs/1193/ Reported by: Saran Neti
-rw-r--r--lib/curl_sasl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c
index d07387d47..c3f2d43f0 100644
--- a/lib/curl_sasl.c
+++ b/lib/curl_sasl.c
@@ -283,6 +283,9 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,
if(result)
return result;
+ if(!chlg)
+ return CURLE_LOGIN_DENIED;
+
/* Retrieve nonce string from the challenge */
if(!sasl_digest_get_key_value(chlg, "nonce=\"", nonce,
sizeof(nonce), '\"')) {