From b1c6b7381577f58ed6dad9641f6d06dda35b762e Mon Sep 17 00:00:00 2001 From: Christos Tsantilas Date: Tue, 17 Jan 2012 01:45:56 -0700 Subject: [PATCH] Bug 3471: Segfault when %la formating code used --- src/format/Format.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.47.2