]> The Tcpdump Group git mirrors - tcpdump/commit
msdp: do some additional bounds checks.
authorGuy Harris <[email protected]>
Wed, 28 Aug 2024 07:09:46 +0000 (00:09 -0700)
committerGuy Harris <[email protected]>
Sun, 8 Sep 2024 23:51:41 +0000 (16:51 -0700)
commit39bafa636678ca3b0aa1ad88e2cdaedd06f5a33d
tree824ed280c87b29269198e61e371cd89933b0d7dd
parentd198d5f774bb8c5cc5c5149acbb064cc66a42ba2
msdp: do some additional bounds checks.

Make sure we don't run past either 1) the end of the packet data (using
ND_TCHECK_LEN() for fields we don't fetch and print) or 2) the end of
the TLV (with a check of length before fetching the T and L, and checks
of L before fetching any further data).

Don't advance sp past the T and L, or decrement length for the T and L,
before parsing the V, so we don't have to subtract 3 from sp in some
cases.

Add some comments.

Define ND_LONGJMP_FROM_TCHECK to do new-style checks.

(cherry picked from commit 66b6e1e05fc355052b34c8f3635bb696cd18f986)
print-msdp.c