]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix invalid use of a pointer in src/auth/negotiate/auth_negotiate.cc.
authoramosjeffries <>
Thu, 2 Aug 2007 10:01:46 +0000 (10:01 +0000)
committeramosjeffries <>
Thu, 2 Aug 2007 10:01:46 +0000 (10:01 +0000)
Another auth function looking up the auth header and scanning it even if
 none was returned. This patch adds NULL tests before scanning.

src/auth/negotiate/auth_negotiate.cc

index 08623a826481e75507eeec56c605c0ddf7b5ccd6..ac725ef9fd3333b6a30a93e707417b6b19347718 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: auth_negotiate.cc,v 1.21 2007/07/04 00:59:13 hno Exp $
+ * $Id: auth_negotiate.cc,v 1.22 2007/08/02 04:01:46 amosjeffries Exp $
  *
  * DEBUG: section 29    Negotiate Authenticator
  * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli
@@ -697,14 +697,16 @@ AuthNegotiateUserRequest::authenticate(HttpRequest * request, ConnStateData::Poi
     /* locate second word */
     blob = proxy_auth;
 
-    while (xisspace(*blob) && *blob)
-        blob++;
+    if(blob) {
+        while (xisspace(*blob) && *blob)
+            blob++;
 
-    while (!xisspace(*blob) && *blob)
-        blob++;
+        while (!xisspace(*blob) && *blob)
+            blob++;
 
-    while (xisspace(*blob) && *blob)
-        blob++;
+        while (xisspace(*blob) && *blob)
+            blob++;
+    }
 
     switch (auth_state) {