From: Christos Tsantilas Date: Tue, 16 Dec 2014 17:55:04 +0000 (+0200) Subject: Bug 4164: SEGFAULT when %W formating code used in errorpages X-Git-Tag: merge-candidate-3-v1~436 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98340a7b8aeafac88486185909cb35d8e12830f8;p=thirdparty%2Fsquid.git Bug 4164: SEGFAULT when %W formating code used in errorpages 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. --- diff --git a/src/errorpage.cc b/src/errorpage.cc index c8bf97810b..9e0fe23348 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -716,7 +716,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)