From: Francois-Xavier Le Bail Date: Fri, 14 May 2021 18:34:35 +0000 (+0200) Subject: IEEE 802.15.4: Add a bounds check X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/d76dc9f90ab9c6188063696668b6f2e749df7911 IEEE 802.15.4: Add a bounds check This avoids to have cp (current pointer on packet data) > ndo->ndo_snapend in hex_and_ascii_print(), via ndo_default_print(), via ND_DEFAULTPRINT(), in some cases. --- diff --git a/print-802_15_4.c b/print-802_15_4.c index 3d307ffd..5687d455 100644 --- a/print-802_15_4.c +++ b/print-802_15_4.c @@ -2021,6 +2021,7 @@ ieee802_15_4_std_frames(netdissect_options *ndo, if (len < 0) { return 0; } + ND_TCHECK_LEN(p, len); p += len; caplen -= len; } else {