]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3471: Segfault when %la formating code used
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 9 Jan 2012 14:31:50 +0000 (16:31 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 9 Jan 2012 14:31:50 +0000 (16:31 +0200)
src/format/Format.cc

index 6344c4cfe269ea9309270971442bdc7b0b36885b..d5a281beb6b87f278d9e22027888e1ad16fdd144 100644 (file)
@@ -371,8 +371,10 @@ Format::Format::assemble(MemBuf &mb, AccessLogEntry *al, int logSequenceNumber)
 
         case LFT_LOCAL_LISTENING_IP: {
             // avoid logging a dash if we have reliable info
-            const bool interceptedAtKnownPort = (al->request->flags.spoof_client_ip ||
-                                                 al->request->flags.intercepted) && al->cache.port;
+            const bool interceptedAtKnownPort = al->request ?
+                                                (al->request->flags.spoof_client_ip ||
+                                                 al->request->flags.intercepted) && al->cache.port :
+                                                false;
             if (interceptedAtKnownPort) {
                 const bool portAddressConfigured = !al->cache.port->s.IsAnyAddr();
                 if (portAddressConfigured)