]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4455: SegFault from ESIInclude::Start
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 11 May 2016 09:05:39 +0000 (12:05 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 11 May 2016 09:05:39 +0000 (12:05 +0300)
merge from trunk-r14661

src/client_side_request.cc

index c62111f1ea01b6adfeef6356108ca1415655ab06..8bd8f6e97d84061ed5e931734bde6534ecfa281e 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);
 }