From: Eduard Bagdasaryan Date: Sun, 31 Jan 2016 05:22:31 +0000 (+1300) Subject: Bug 4378: assertion failed: DestinationIp.cc:60: 'checklist->conn() && checklist... X-Git-Tag: SQUID_3_5_14~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9790b54b1343f6bdc051210360b31533c94271f1;p=thirdparty%2Fsquid.git Bug 4378: assertion failed: DestinationIp.cc:60: 'checklist->conn() && checklist->conn()->clientConnection != NULL' --- diff --git a/src/acl/DestinationIp.cc b/src/acl/DestinationIp.cc index 00e027e493..aa316f8913 100644 --- a/src/acl/DestinationIp.cc +++ b/src/acl/DestinationIp.cc @@ -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)) { diff --git a/src/acl/FilledChecklist.cc b/src/acl/FilledChecklist.cc index f390c1868c..f2f5179f24 100644 --- a/src/acl/FilledChecklist.cc +++ b/src/acl/FilledChecklist.cc @@ -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; }