]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4465: Header forgery detection leads to crash
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 17 Apr 2016 10:54:24 +0000 (22:54 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 17 Apr 2016 10:54:24 +0000 (22:54 +1200)
src/client_side_request.cc

index e2b3e1010e7ae1c50578a6d6a79fe17f5a4fa5d5..cbcc9bc9f0cc0a98cd337b2da78e49fa6e31e509 100644 (file)
@@ -554,7 +554,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(HDR_USER_AGENT));
+    if (const char *ua = http->request->header.getStr(HDR_USER_AGENT))
+        debugs(85, DBG_IMPORTANT, "SECURITY ALERT: By user agent: " << ua);
     debugs(85, DBG_IMPORTANT, "SECURITY ALERT: on URL: " << urlCanonical(http->request));
 
     // IP address validation for Host: failed. reject the connection.