]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4378: assertion failed: DestinationIp.cc:60: 'checklist->conn() && checklist...
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sun, 31 Jan 2016 05:22:31 +0000 (18:22 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 31 Jan 2016 05:22:31 +0000 (18:22 +1300)
src/acl/DestinationIp.cc
src/acl/FilledChecklist.cc

index 00e027e4932858aaf1346d0d0c3af861ef84b0e9..aa316f8913f47727aaecab48feef7e49efc91863 100644 (file)
@@ -38,8 +38,9 @@ ACLDestinationIP::match(ACLChecklist *cl)
     // To resolve this we will force DIRECT and only to the original client destination.
     // In which case, we also need this ACL to accurately match the destination
     if (Config.onoff.client_dst_passthru && (checklist->request->flags.intercepted || checklist->request->flags.interceptTproxy)) {
-        assert(checklist->conn() && checklist->conn()->clientConnection != NULL);
-        return ACLIP::match(checklist->conn()->clientConnection->local);
+        const ConnStateData *conn = checklist->conn();
+        return (conn != NULL && conn->clientConnection != NULL) ?
+            ACLIP::match(conn->clientConnection->local) : -1;
     }
 
     if (flags.isSet(ACL_F_NO_LOOKUP)) {
index f390c1868c145263243182cb013d6c05dc1ed75d..f2f5179f24f56cb7245abd1e441689a28c678a82 100644 (file)
@@ -69,7 +69,7 @@ ACLFilledChecklist::~ACLFilledChecklist()
 ConnStateData *
 ACLFilledChecklist::conn() const
 {
-    return  conn_;
+    return cbdataReferenceValid(conn_) ? conn_ : NULL;
 }
 
 void
@@ -84,13 +84,15 @@ ACLFilledChecklist::conn(ConnStateData *aConn)
 int
 ACLFilledChecklist::fd() const
 {
-    return (conn_ != NULL && conn_->clientConnection != NULL) ? conn_->clientConnection->fd : fd_;
+    const ConnStateData *c = conn();
+    return (c != NULL && c->clientConnection != NULL) ? c->clientConnection->fd : fd_;
 }
 
 void
 ACLFilledChecklist::fd(int aDescriptor)
 {
-    assert(!conn() || conn()->clientConnection == NULL || conn()->clientConnection->fd == aDescriptor);
+    const ConnStateData *c = conn();
+    assert(!c || !c->clientConnection || c->clientConnection->fd == aDescriptor);
     fd_ = aDescriptor;
 }