]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4164: SEGFAULT when %W formating code used in errorpages
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 18 Dec 2014 14:40:46 +0000 (06:40 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 18 Dec 2014 14:40:46 +0000 (06:40 -0800)
Squid will crash inside ErrorState::Dump if not authentication configured for
squid. In this case ErrorState::auth_user_request is NULL and trying to access
a method of this object will cause segfault to squid.

src/errorpage.cc

index 6a01da7d91b6d81a159c1a9f5d06f79e93f0de75..8c6270aac90e0a681989fe7c53ecb14e8c98b63f 100644 (file)
@@ -736,7 +736,7 @@ ErrorState::Dump(MemBuf * mb)
         str.Printf("Err: [none]\r\n");
     }
 #if USE_AUTH
-    if (auth_user_request->denyMessage())
+    if (auth_user_request.getRaw() && auth_user_request->denyMessage())
         str.Printf("Auth ErrMsg: %s\r\n", auth_user_request->denyMessage());
 #endif
     if (dnsError.size() > 0)