]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix crash reading malformed config files
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Sep 2014 16:38:44 +0000 (09:38 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Sep 2014 16:38:44 +0000 (09:38 -0700)
If ConfigParser::QuotedOrToEol() happend to return NULL. Which may happen
if there is no token before end of current file the auth module config
parser would crash.

  Detected by Coverity Scan. Issue 1222662.

src/auth/Config.cc

index fb2ef3f9198f0dbe58ca5c12dfecb40174a991e9..8798180907d9ec72474fe9d90816b236983e399d 100644 (file)
@@ -86,7 +86,7 @@ Auth::Config::parse(Auth::Config * scheme, int n_configured, char *param_str)
 
         char *token = ConfigParser::NextQuotedOrToEol();
 
-        while (*token && xisspace(*token))
+        while (token && *token && xisspace(*token))
             ++token;
 
         if (!token || !*token) {