From: Amos Jeffries Date: Fri, 6 May 2016 08:24:29 +0000 (+1200) Subject: Bug 4455: SegFault from ESIInclude::Start X-Git-Tag: SQUID_3_5_18~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11afcff148e403237d2f96cbd212942dd34126de;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 cbcc9bc9f0..05de6dac04 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -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;