From: Amos Jeffries Date: Fri, 1 Feb 2013 04:57:13 +0000 (-0700) Subject: Bug 3687: unhandled exception: c when using interception and peers X-Git-Tag: SQUID_3_2_7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c20c288565b6172e113d4e1e96495d48084b8ab3;p=thirdparty%2Fsquid.git Bug 3687: unhandled exception: c when using interception and peers --- diff --git a/src/peer_select.cc b/src/peer_select.cc index d412f61d2c..fb3f20d775 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -243,15 +243,18 @@ peerSelectDnsPaths(ps_state *psstate) const bool useOriginalDst = Config.onoff.client_dst_passthru || !req->flags.hostVerified; const bool choseDirect = fs && fs->code == HIER_DIRECT; if (isIntercepted && useOriginalDst && choseDirect) { - // construct a "result" adding the ORIGINAL_DST to the set instead of DIRECT - Comm::ConnectionPointer p = new Comm::Connection(); - p->remote = req->clientConnectionManager->clientConnection->local; - p->peerType = fs->code; - p->setPeer(fs->_peer); - - // check for a configured outgoing address for this destination... - getOutgoingAddress(psstate->request, p); - psstate->paths->push_back(p); + // check the client is still around before using any of its details + if (req->clientConnectionManager.valid()) { + // construct a "result" adding the ORIGINAL_DST to the set instead of DIRECT + Comm::ConnectionPointer p = new Comm::Connection(); + p->remote = req->clientConnectionManager->clientConnection->local; + p->peerType = fs->code; + p->setPeer(fs->_peer); + + // check for a configured outgoing address for this destination... + getOutgoingAddress(psstate->request, p); + psstate->paths->push_back(p); + } // clear the used fs and continue psstate->servers = fs->next;