From: Benoît Ganne Date: Thu, 24 Feb 2022 15:17:52 +0000 (+0100) Subject: ip: fix overflow in ip6_ext_header_walk X-Git-Tag: v22.10-rc0~315 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F35542%2F2;p=vpp.git ip: fix overflow in ip6_ext_header_walk ip6_ext_hdr_chain_t->eh is IP6_EXT_HDR_MAX elements. Type: fix Change-Id: I28b8d610d8f5c0c520c8391c37b86e837655ab12 Signed-off-by: Benoît Ganne --- diff --git a/src/vnet/ip/ip6_packet.h b/src/vnet/ip/ip6_packet.h index b00eac72c04..e71604ce7d3 100644 --- a/src/vnet/ip/ip6_packet.h +++ b/src/vnet/ip/ip6_packet.h @@ -652,7 +652,7 @@ ip6_ext_header_walk (vlib_buffer_t *b, ip6_header_t *ip, int find_hdr_type, i++; if (last) break; - if (i > IP6_EXT_HDR_MAX) + if (i >= IP6_EXT_HDR_MAX) break; next_header = ip6_ext_next_header_s (next_proto, next_header, max_offset, &offset, &next_proto, &last);