Blame SOURCES/squid-3.5.20-CVE-2018-1000027.patch

9ae52b
commit 8232b83d3fa47a1399f155cb829db829369fbae9 (refs/remotes/origin/v3.5)
9ae52b
Author: squidadm <squidadm@users.noreply.github.com>
9ae52b
Date:   2018-01-21 08:07:08 +1300
9ae52b
9ae52b
    Fix indirect IP logging for transactions without a client connection (#129) (#136)
9ae52b
9ae52b
diff --git a/src/client_side_request.cc b/src/client_side_request.cc
9ae52b
index be124f3..203f89d 100644
9ae52b
--- a/src/client_side_request.cc
9ae52b
+++ b/src/client_side_request.cc
9ae52b
@@ -488,9 +488,9 @@ clientFollowXForwardedForCheck(allow_t answer, void *data)
9ae52b
         * Ensure that the access log shows the indirect client
9ae52b
         * instead of the direct client.
9ae52b
         */
9ae52b
-        ConnStateData *conn = http->getConn();
9ae52b
-        conn->log_addr = request->indirect_client_addr;
9ae52b
-        http->al->cache.caddr = conn->log_addr;
9ae52b
+        http->al->cache.caddr = request->indirect_client_addr;
9ae52b
+        if (ConnStateData *conn = http->getConn())
9ae52b
+            conn->log_addr = request->indirect_client_addr;
9ae52b
     }
9ae52b
     request->x_forwarded_for_iterator.clean();
9ae52b
     request->flags.done_follow_x_forwarded_for = true;