Commit fa5fa65a authored by Isaac Boukris's avatar Isaac Boukris Committed by Daniel Stenberg
Browse files

NTLM: check for NULL pointer before deferencing

At ConnectionExists, both check->proxyuser and check->proxypasswd
could be NULL, so make sure to check first.

Fixes #765
parent 4fbd5769
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -3444,6 +3444,10 @@ ConnectionExists(struct SessionHandle *data,


        /* Same for Proxy NTLM authentication */
        /* Same for Proxy NTLM authentication */
        if(wantProxyNTLMhttp) {
        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) ||
          if(!strequal(needle->proxyuser, check->proxyuser) ||
             !strequal(needle->proxypasswd, check->proxypasswd))
             !strequal(needle->proxypasswd, check->proxypasswd))
            continue;
            continue;