]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4455: SegFault from ESIInclude::Start
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 May 2016 01:48:49 +0000 (13:48 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 May 2016 01:48:49 +0000 (13:48 +1200)
src/client_side_request.cc

index 9c7254d71798019c77eece1a454e5072b03614c0..d8da5694124e3dc10e9b2e96d7347a17514d4e90 100644 (file)
@@ -169,16 +169,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 (auto ssl = fd_table[aConn->clientConnection->fd].ssl.get())
-            al->cache.sslClientCert.reset(SSL_get_peer_certificate(ssl));
-    }
+        if (aConn->clientConnection != NULL && aConn->clientConnection->isOpen()) {
+            if (auto ssl = fd_table[aConn->clientConnection->fd].ssl.get())
+                al->cache.sslClientCert.reset(SSL_get_peer_certificate(ssl));
+        }
 #endif
+    }
     dlinkAdd(this, &active, &ClientActiveRequests);
 }