Commit e480b6d0 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

wininet: Fix a possible NULL pointer deference.

parent 0076e33d
...@@ -108,19 +108,22 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) ...@@ -108,19 +108,22 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
* dealing with 'Basic' Authentication * dealing with 'Basic' Authentication
*/ */
p = strchrW( szBuf, ' ' ); p = strchrW( szBuf, ' ' );
if( p && !strncmpW( p+1, szRealm, strlenW(szRealm) ) ) if( !p || strncmpW( p+1, szRealm, strlenW(szRealm) ) )
{ {
/* remove quotes */ ERR("proxy response wrong? (%s)\n", debugstr_w(szBuf));
p += 7; return FALSE;
if( *p == '"' )
{
p++;
q = strrchrW( p, '"' );
if( q )
*q = 0;
}
} }
/* remove quotes */
p += 7;
if( *p == '"' )
{
p++;
q = strrchrW( p, '"' );
if( q )
*q = 0;
}
strcpyW( szBuf, p ); strcpyW( szBuf, p );
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment