From: amosjeffries <> Date: Thu, 2 Aug 2007 10:01:46 +0000 (+0000) Subject: Fix invalid use of a pointer in src/auth/negotiate/auth_negotiate.cc. X-Git-Tag: SQUID_3_0_PRE7~124 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4e95a930ab9c65898aa0fad61e4efe56eb84d22c;p=thirdparty%2Fsquid.git Fix invalid use of a pointer in src/auth/negotiate/auth_negotiate.cc. Another auth function looking up the auth header and scanning it even if none was returned. This patch adds NULL tests before scanning. --- diff --git a/src/auth/negotiate/auth_negotiate.cc b/src/auth/negotiate/auth_negotiate.cc index 08623a8264..ac725ef9fd 100644 --- a/src/auth/negotiate/auth_negotiate.cc +++ b/src/auth/negotiate/auth_negotiate.cc @@ -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) {