From: Amos Jeffries Date: Fri, 6 May 2016 09:12:44 +0000 (+1200) Subject: Bug 4455: SegFault from ESIInclude::Start X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad6a06aaaa58b2aaabe4c3b8ad6cfe5aa98a7e6d;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 232130b835..23b90d6f70 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -163,13 +163,15 @@ ClientHttpRequest::ClientHttpRequest(ConnStateData * aConn) : start_time = current_time; setConn(aConn); al = new AccessLogEntry; - al->tcpClient = clientConnection = aConn->clientConnection; + if (aConn) { + al->tcpClient = clientConnection = aConn->clientConnection; #if USE_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)); - } + 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;