------------------------------------------------------------ revno: 14015 revision-id: squid3@treenet.co.nz-20160330134757-7rf7qfe63b0vfcvz parent: squid3@treenet.co.nz-20160330132534-cy3jwop0nsf1406o author: Yuriy M. Kaminskiy committer: Amos Jeffries branch nick: 3.5 timestamp: Thu 2016-03-31 02:47:57 +1300 message: pinger: Fix buffer overflow in Icmp6::Recv ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20160330134757-7rf7qfe63b0vfcvz # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: b32bec7f15917f1d41f3f97ae22c2047ff822ad5 # timestamp: 2016-03-30 13:48:32 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20160330132534-\ # cy3jwop0nsf1406o # # Begin patch === modified file 'src/icmp/Icmp6.cc' --- src/icmp/Icmp6.cc 2016-01-01 00:14:27 +0000 +++ src/icmp/Icmp6.cc 2016-03-30 13:47:57 +0000 @@ -256,7 +256,7 @@ #define ip6_hops // HOPS!!! (can it be true??) ip = (struct ip6_hdr *) pkt; - pkt += sizeof(ip6_hdr); + NP: echo size needs to +sizeof(ip6_hdr); debugs(42, DBG_CRITICAL, HERE << "ip6_nxt=" << ip->ip6_nxt << ", ip6_plen=" << ip->ip6_plen << @@ -267,7 +267,6 @@ */ icmp6header = (struct icmp6_hdr *) pkt; - pkt += sizeof(icmp6_hdr); if (icmp6header->icmp6_type != ICMP6_ECHO_REPLY) { @@ -292,7 +291,7 @@ return; } - echo = (icmpEchoData *) pkt; + echo = (icmpEchoData *) (pkt + sizeof(icmp6_hdr)); preply.opcode = echo->opcode;