Skip to content

Commit

Permalink
Merge pull request #842 from GabrielGanne/ipv6-extension-ength
Browse files Browse the repository at this point in the history
ipv6 - add check for extension header length
  • Loading branch information
fklassen authored Jun 1, 2024
2 parents 914a62e + 52ed633 commit 77f02cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/get.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ get_ipv6_next(struct tcpr_ipv6_ext_hdr_base *exthdr, const u_char *end_ptr)
case TCPR_IPV6_NH_HBH:
case TCPR_IPV6_NH_AH:
extlen = IPV6_EXTLEN_TO_BYTES(exthdr->ip_len);
if (extlen == 0) {
dbg(3, "Malformed IPv6 extension header...");
return NULL;
}
dbgx(3,
"Looks like we're an ext header (0x%hhx). Jumping %u bytes"
" to the next",
Expand Down

0 comments on commit 77f02cb

Please sign in to comment.