]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4392: assertion CbcPointer.h:159: 'c' via tunnelServerClosed or tunnelClientClosed
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Dec 2015 18:00:46 +0000 (10:00 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Dec 2015 18:00:46 +0000 (10:00 -0800)
src/tunnel.cc

index fae2526ed2551836fe1eaa2d59342e29e0094f3d..828fbe2730f0e0ebab9bb10d2e6aceac9f4e3df0 100644 (file)
@@ -243,9 +243,12 @@ tunnelServerClosed(const CommCloseCbParams &params)
 
     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 &params)
 
     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;
     }