From: Amos Jeffries Date: Tue, 3 May 2016 01:48:49 +0000 (+1200) Subject: Bug 4455: SegFault from ESIInclude::Start X-Git-Tag: SQUID_4_0_10~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70b0f93850ed4df78fc889e26a2bbc5f7368723b;p=thirdparty%2Fsquid.git Bug 4455: SegFault from ESIInclude::Start --- diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 9c7254d717..d8da569412 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -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); }