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

index a823c622be4ec774f1cd815d0f80b242a470d72b..6f8931b2ef2fa73813485075162e6d739f3ca120 100644 (file)
@@ -513,7 +513,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 : nullptr);
     const bool relay = pwd && (strcmp(pwd, "PASS") == 0 || strcmp(pwd, "PASSTHRU") == 0) &&
                        (*status_ptr == Http::scProxyAuthenticationRequired ||
                         *status_ptr == Http::scUnauthorized);