]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug fix: HttpRequest::flags.intercepted, HttpRequest::flags.spoof_client_ip neve
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 23 Nov 2011 17:04:13 +0000 (19:04 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 23 Nov 2011 17:04:13 +0000 (19:04 +0200)
r set

The request_flags::intercepted,request_flags::spoof_client_ip are 1 bit integers
 so when you are try to set to an integer bigger than 1 will overflow and the
results will not be what you are expecting.

src/client_side.cc

index 7e07cdab93fd9e59dd4730bb8d6dd7d679a21f64..2504571bf4310cec8b3676bdd2c7fd2968af0e55 100644 (file)
@@ -2541,8 +2541,8 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
      * from the port settings to the request.
      */
     if (http->clientConnection != NULL) {
-        request->flags.intercepted = (http->clientConnection->flags & COMM_INTERCEPTION);
-        request->flags.spoof_client_ip = (http->clientConnection->flags & COMM_TRANSPARENT);
+        request->flags.intercepted = ((http->clientConnection->flags & COMM_INTERCEPTION) != 0);
+        request->flags.spoof_client_ip = ((http->clientConnection->flags & COMM_TRANSPARENT) != 0 ) ;
     }
 
     if (internalCheck(request->urlpath.termedBuf())) {