]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: ICAP adaptation pointer handling
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 15 Jan 2014 01:54:19 +0000 (14:54 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 15 Jan 2014 01:54:19 +0000 (14:54 +1300)
Divert unlikely but possible request NULL pointer into the Must()
condition handler for missing History data.

 Detected by Coverity Scan. Issue 740365.

src/adaptation/icap/ModXact.cc

index ec793785629f514c0d19c0b8f88f82729c1d81c7..dbe94b3725c8be64cfdc24d4c5b0aabc652d415e 100644 (file)
@@ -1262,7 +1262,7 @@ void Adaptation::Icap::ModXact::finalizeLogInfo()
         reply_ = dynamic_cast<HttpReply*>(adapted.header);
     }
 
-    Adaptation::Icap::History::Pointer h = request_->icapHistory();
+    Adaptation::Icap::History::Pointer h = (request_ ? request_->icapHistory() : NULL);
     Must(h != NULL); // ICAPXaction::maybeLog calls only if there is a log
     al.icp.opcode = ICP_INVALID;
     al.url = h->log_uri.termedBuf();