]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4406: SIGSEV in TunnelStateData::handleConnectResponse() during reconfigure and...
authorMichael Buchau <mike@m-buchau.de>
Fri, 9 Dec 2016 04:33:04 +0000 (17:33 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 Dec 2016 04:33:04 +0000 (17:33 +1300)
src/tunnel.cc

index 73d64115af494a26b2ab955593949914ab37c7a8..2cb9a7e1d34a790a0b64bf3c2dfaa0b879be6f8e 100644 (file)
@@ -475,7 +475,8 @@ TunnelStateData::handleConnectResponse(const size_t chunkSize)
     *status_ptr = rep.sline.status();
 
     // we need to relay the 401/407 responses when login=PASS(THRU)
-    const char *pwd = server.conn->getPeer()->login;
+    const CachePeer *peer = server.conn->getPeer();
+    const char *pwd = (peer ? peer->login : NULL);
     const bool relay = pwd && (strcmp(pwd, "PASS") == 0 || strcmp(pwd, "PASSTHRU") == 0) &&
                        (*status_ptr == Http::scProxyAuthenticationRequired ||
                         *status_ptr == Http::scUnauthorized);