]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4455: SegFault from ESIInclude::Start
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 6 May 2016 08:24:29 +0000 (20:24 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 6 May 2016 08:24:29 +0000 (20:24 +1200)
src/client_side_request.cc

index cbcc9bc9f0cc0a98cd337b2da78e49fa6e31e509..05de6dac0433016090842297b55171e2d6ebf1ce 100644 (file)
@@ -141,16 +141,18 @@ ClientHttpRequest::ClientHttpRequest(ConnStateData * aConn) :
     setConn(aConn);
     al = new AccessLogEntry;
     al->cache.start_time = current_time;
-    al->tcpClient = clientConnection = aConn->clientConnection;
-    al->cache.port = aConn->port;
-    al->cache.caddr = aConn->log_addr;
+    if (aConn) {
+        al->tcpClient = clientConnection = aConn->clientConnection;
+        al->cache.port = aConn->port;
+        al->cache.caddr = aConn->log_addr;
 
 #if USE_OPENSSL
-    if (aConn->clientConnection != NULL && aConn->clientConnection->isOpen()) {
-        if (SSL *ssl = fd_table[aConn->clientConnection->fd].ssl)
-            al->cache.sslClientCert.reset(SSL_get_peer_certificate(ssl));
-    }
+        if (aConn->clientConnection != NULL && aConn->clientConnection->isOpen()) {
+            if (SSL *ssl = fd_table[aConn->clientConnection->fd].ssl)
+                al->cache.sslClientCert.reset(SSL_get_peer_certificate(ssl));
+        }
 #endif
+    }
     dlinkAdd(this, &active, &ClientActiveRequests);
 #if USE_ADAPTATION
     request_satisfaction_mode = false;