From: Christos Tsantilas Date: Mon, 24 Oct 2016 08:31:40 +0000 (+0300) Subject: Fix bug introduced by r14838. X-Git-Tag: SQUID_4_0_16~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7171d5fbe2653c8356bc92cea6791dc8fff989c0;p=thirdparty%2Fsquid.git Fix bug introduced by r14838. Squid crashed because HttpMsg::body_pipe was used without check that it was initialized. The message lacks body pipe when it has no body or empty body. --- diff --git a/src/adaptation/icap/ModXact.cc b/src/adaptation/icap/ModXact.cc index 89ac65359a..b5f3fe09dc 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -1309,7 +1309,8 @@ void Adaptation::Icap::ModXact::finalizeLogInfo() virgin_msg = virgin_request_; assert(virgin_msg != virgin.cause); al.http.clientRequestSz.header = virgin_msg->hdr_sz; - al.http.clientRequestSz.payloadData = virgin_msg->body_pipe->producedSize(); + if (virgin_msg->body_pipe != NULL) + al.http.clientRequestSz.payloadData = virgin_msg->body_pipe->producedSize(); // leave al.icap.bodyBytesRead negative if no body if (replyHttpHeaderSize >= 0 || replyHttpBodySize >= 0) {