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
This commit is contained in:
Isaac Boukris 2016-04-16 11:49:09 +03:00 committed by Daniel Stenberg
parent 4fbd576930
commit fa5fa65a30
1 changed files with 4 additions and 0 deletions

View File

@ -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;