diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1429,6 +1429,8 @@ nxt = ip6->ip6_nxt; len = sizeof(struct ip6_hdr); while (len < off) { + if (len + sizeof(struct ip6_ext) > m->m_len) + return NULL; ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + len); switch (nxt) {