From: Christos Tsantilas Date: Wed, 11 May 2016 09:05:39 +0000 (+0300) Subject: Bug 4455: SegFault from ESIInclude::Start X-Git-Tag: SQUID_4_0_13~5^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5525bd305b8386ffc9d64d0a8434e9feea984394;p=thirdparty%2Fsquid.git Bug 4455: SegFault from ESIInclude::Start merge from trunk-r14661 --- diff --git a/src/client_side_request.cc b/src/client_side_request.cc index c62111f1ea..8bd8f6e97d 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); }