]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix regression bug introduced by r14089.
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 25 Oct 2016 08:19:49 +0000 (21:19 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 25 Oct 2016 08:19:49 +0000 (21:19 +1300)
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 f8a57ae96fed879987a29459fb1a6a90e208dcc5..f9375d3bccc8f9c8395d1ba7495959c30c021201 100644 (file)
@@ -1303,7 +1303,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) {