]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix bug introduced by r14838.
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 24 Oct 2016 08:31:40 +0000 (11:31 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 24 Oct 2016 08:31:40 +0000 (11:31 +0300)
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.

src/adaptation/icap/ModXact.cc

index 89ac65359aa8fca7a839fdf025e1c548aeb016f9..b5f3fe09dca8f85969da3e5459f5534069e75a5f 100644 (file)
@@ -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) {