From 47176c0b623f8aab8061c38082f69b01fef600ff Mon Sep 17 00:00:00 2001 From: Christos Tsantilas Date: Mon, 9 Jan 2012 16:31:50 +0200 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