------------------------------------------------------------ revno: 10495 revision-id: squid3@treenet.co.nz-20160330144753-t66h1goeagnq0e0c parent: squid3@treenet.co.nz-20150730035108-trkfhm8lutp4rgjp author: Yuriy M. Kaminskiy committer: Amos Jeffries branch nick: 3.1 timestamp: Thu 2016-03-31 03:47:53 +1300 message: pinger: Fix buffer overflow in Icmp6::Recv ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20160330144753-t66h1goeagnq0e0c # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_1 # testament_sha1: 6bc2eabd34569da1e51addb052c7187d95f37fec # timestamp: 2016-03-30 14:50:15 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.1 # base_revision_id: squid3@treenet.co.nz-20150730035108-\ # trkfhm8lutp4rgjp # # Begin patch === modified file 'src/icmp/Icmp6.cc' --- src/icmp/Icmp6.cc 2015-06-12 03:32:40 +0000 +++ src/icmp/Icmp6.cc 2016-03-30 14:47:53 +0000 @@ -278,7 +278,7 @@ ip = (struct ip6_hdr *) pkt; - pkt += sizeof(ip6_hdr); + NP: echo size needs to +sizeof(ip6_hdr); debugs(42,0, HERE << "ip6_nxt=" << ip->ip6_nxt << ", ip6_plen=" << ip->ip6_plen << @@ -289,7 +289,6 @@ */ icmp6header = (struct icmp6_hdr *) pkt; - pkt += sizeof(icmp6_hdr); if (icmp6header->icmp6_type != ICMP6_ECHO_REPLY) { @@ -312,7 +311,7 @@ return; } - echo = (icmpEchoData *) pkt; + echo = (icmpEchoData *) (pkt + sizeof(icmp6_hdr)); preply.opcode = echo->opcode;