]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3085: Crash when parsing esi:include
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 Jan 2012 22:11:51 +0000 (15:11 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 Jan 2012 22:11:51 +0000 (15:11 -0700)
src/client_side_request.cc

index 6fdcde9b6b7a26ee300bc907370a16d184b39951..531e43785904a30bedfad54f84fcf08a36d01f7e 100644 (file)
@@ -873,18 +873,22 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
         request->flags.auth = 1;
 
     ConnStateData *http_conn = http->getConn();
-    assert(http_conn);
-    request->flags.connection_auth_disabled = http_conn->port->connection_auth_disabled;
-    if (!request->flags.connection_auth_disabled) {
-        if (http_conn->pinning.fd != -1) {
-            if (http_conn->pinning.auth) {
-                request->flags.connection_auth = 1;
-                request->flags.auth = 1;
-            } else {
-                request->flags.connection_proxy_auth = 1;
+    if (http_conn) {
+        request->flags.connection_auth_disabled = http_conn->port->connection_auth_disabled;
+        if (!request->flags.connection_auth_disabled) {
+            if (http_conn->pinning.fd != -1) {
+                if (http_conn->pinning.auth) {
+                    request->flags.connection_auth = 1;
+                    request->flags.auth = 1;
+                } else {
+                    request->flags.connection_proxy_auth = 1;
+                }
+                request->setPinnedConnection(http_conn);
             }
-            request->setPinnedConnection(http_conn);
         }
+    } else {
+        // internal requests and ESI don't have client conn.
+        request->flags.connection_auth_disabled = 1;
     }
 
     /* check if connection auth is used, and flag as candidate for pinning