From: Alex Rousskov Date: Sat, 9 Apr 2016 15:35:34 +0000 (+1200) Subject: Bug 4465: Header forgery detection leads to crash X-Git-Tag: SQUID_4_0_9~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d610d0180142d2035d877d1ad4a8e71fc8a813b3;p=thirdparty%2Fsquid.git Bug 4465: Header forgery detection leads to crash --- diff --git a/src/client_side_request.cc b/src/client_side_request.cc index df18d5e51a..9c7254d717 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -574,7 +574,8 @@ ClientRequestContext::hostHeaderVerifyFailed(const char *A, const char *B) debugs(85, DBG_IMPORTANT, "SECURITY ALERT: Host header forgery detected on " << http->getConn()->clientConnection << " (" << A << " does not match " << B << ")"); - debugs(85, DBG_IMPORTANT, "SECURITY ALERT: By user agent: " << http->request->header.getStr(Http::HdrType::USER_AGENT)); + if (const char *ua = http->request->header.getStr(Http::HdrType::USER_AGENT)) + debugs(85, DBG_IMPORTANT, "SECURITY ALERT: By user agent: " << ua); debugs(85, DBG_IMPORTANT, "SECURITY ALERT: on URL: " << http->request->effectiveRequestUri()); // IP address validation for Host: failed. reject the connection.