From: Christos Tsantilas Date: Tue, 17 Jan 2012 08:45:56 +0000 (-0700) Subject: Bug 3471: Segfault when %la formating code used X-Git-Tag: SQUID_3_2_0_15~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1c6b7381577f58ed6dad9641f6d06dda35b762e;p=thirdparty%2Fsquid.git Bug 3471: Segfault when %la formating code used --- diff --git a/src/format/Format.cc b/src/format/Format.cc index 6344c4cfe2..d5a281beb6 100644 --- a/src/format/Format.cc +++ b/src/format/Format.cc @@ -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)