]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix type-punned pointer in forwarding
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 16 Dec 2009 01:12:27 +0000 (14:12 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 16 Dec 2009 01:12:27 +0000 (14:12 +1300)
src/forward.cc

index 0601356b521010e3955bd1619c45927bd3bc7a71..20ac39aa9f0985ae92a50db81b8cd0501adae1dc 100644 (file)
@@ -999,7 +999,8 @@ FwdState::dispatch()
                         break;
 
                     if (o->cmsg_level == SOL_IP && o->cmsg_type == IP_TOS) {
-                        clientFde->upstreamTOS = (unsigned char)(*(int*)CMSG_DATA(o));
+                        int *tmp = (int*)CMSG_DATA(o);
+                        clientFde->upstreamTOS = (unsigned char)*tmp;
                         break;
                     }
                     pbuf += CMSG_LEN(o->cmsg_len);