From: Amos Jeffries Date: Fri, 4 Dec 2015 18:00:46 +0000 (-0800) Subject: Bug 4392: assertion CbcPointer.h:159: 'c' via tunnelServerClosed or tunnelClientClosed X-Git-Tag: SQUID_4_0_4~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=056ddbd70af03c4a8fdbf5b2474da8522132b9b9;p=thirdparty%2Fsquid.git Bug 4392: assertion CbcPointer.h:159: 'c' via tunnelServerClosed or tunnelClientClosed --- diff --git a/src/tunnel.cc b/src/tunnel.cc index fae2526ed2..828fbe2730 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -243,9 +243,12 @@ tunnelServerClosed(const CommCloseCbParams ¶ms) if (tunnelState->noConnections()) { // ConnStateData pipeline should contain the CONNECT we are performing - auto ctx = tunnelState->http->getConn()->pipeline.front(); - if (ctx != nullptr) - ctx->finished(); + // but it may be invalid already (bug 4392) + if (tunnelState->http.valid() && tunnelState->http->getConn()) { + auto ctx = tunnelState->http->getConn()->pipeline.front(); + if (ctx != nullptr) + ctx->finished(); + } delete tunnelState; return; } @@ -266,9 +269,12 @@ tunnelClientClosed(const CommCloseCbParams ¶ms) if (tunnelState->noConnections()) { // ConnStateData pipeline should contain the CONNECT we are performing - auto ctx = tunnelState->http->getConn()->pipeline.front(); - if (ctx != nullptr) - ctx->finished(); + // but it may be invalid already (bug 4392) + if (tunnelState->http.valid() && tunnelState->http->getConn()) { + auto ctx = tunnelState->http->getConn()->pipeline.front(); + if (ctx != nullptr) + ctx->finished(); + } delete tunnelState; return; }