Mike McCormack : wininet: Fix a possible NULL pointer deference.

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 24 07:49:08 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: e480b6d07dc79451aeb9c1410a667269727eb5c4
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=e480b6d07dc79451aeb9c1410a667269727eb5c4

Author: Mike McCormack <mike at codeweavers.com>
Date:   Wed May 24 19:28:26 2006 +0900

wininet: Fix a possible NULL pointer deference.

---

 dlls/wininet/dialogs.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c
index d6f14e3..1b160e6 100644
--- a/dlls/wininet/dialogs.c
+++ b/dlls/wininet/dialogs.c
@@ -108,19 +108,22 @@ static BOOL WININET_GetAuthRealm( HINTER
      * 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;




More information about the wine-cvs mailing list