From e480b6d07dc79451aeb9c1410a667269727eb5c4 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 24 May 2006 19:28:26 +0900 Subject: [PATCH] wininet: Fix a possible NULL pointer deference. --- dlls/wininet/dialogs.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c index d6f14e36d78..1b160e6363b 100644 --- a/dlls/wininet/dialogs.c +++ b/dlls/wininet/dialogs.c @@ -108,19 +108,22 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) * dealing with 'Basic' Authentication */ p = strchrW( szBuf, ' ' ); - if( p && !strncmpW( p+1, szRealm, strlenW(szRealm) ) ) + if( !p || strncmpW( p+1, szRealm, strlenW(szRealm) ) ) { - /* remove quotes */ - p += 7; - if( *p == '"' ) - { - p++; - q = strrchrW( p, '"' ); - if( q ) - *q = 0; - } + ERR("proxy response wrong? (%s)\n", debugstr_w(szBuf)); + return FALSE; } + + /* remove quotes */ + p += 7; + if( *p == '"' ) + { + p++; + q = strrchrW( p, '"' ); + if( q ) + *q = 0; + } strcpyW( szBuf, p ); return TRUE;