]> granicus.if.org Git - curl/commitdiff
NTLM: check for NULL pointer before deferencing
authorIsaac Boukris <iboukris@gmail.com>
Sat, 16 Apr 2016 08:49:09 +0000 (11:49 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 20 Apr 2016 13:26:45 +0000 (15:26 +0200)
At ConnectionExists, both check->proxyuser and check->proxypasswd
could be NULL, so make sure to check first.

Fixes #765

lib/url.c

index 184e270497b5fe6107e4d6325d46a526ed38bd86..b50ca8677105cd9238adc3e242130f2e2eb01e22 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3444,6 +3444,10 @@ ConnectionExists(struct SessionHandle *data,
 
         /* Same for Proxy NTLM authentication */
         if(wantProxyNTLMhttp) {
+          /* Both check->proxyuser and check->proxypasswd could be NULL */
+          if(check->proxyuser == NULL || check->proxypasswd == NULL)
+            continue;
+
           if(!strequal(needle->proxyuser, check->proxyuser) ||
              !strequal(needle->proxypasswd, check->proxypasswd))
             continue;