diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-10 15:34:55 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-18 15:00:48 +0100 |
commit | 46b3858b27d78e14a220f8d251fd7ab28a5244f4 (patch) | |
tree | 95e29e1fdafe3d709895f30df44a6716652041c9 /freebsd/contrib/tcpdump/print-fr.c | |
parent | epoch01: Update due to API changes (diff) | |
download | rtems-libbsd-46b3858b27d78e14a220f8d251fd7ab28a5244f4.tar.bz2 |
Update to FreeBSD stable/12 2020-02-10
Git mirror commit 0d1c391321b34b3025cf0e72f2231d836ff76da8.
Diffstat (limited to 'freebsd/contrib/tcpdump/print-fr.c')
-rw-r--r-- | freebsd/contrib/tcpdump/print-fr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/freebsd/contrib/tcpdump/print-fr.c b/freebsd/contrib/tcpdump/print-fr.c index 1b9f0c71..59a50c9f 100644 --- a/freebsd/contrib/tcpdump/print-fr.c +++ b/freebsd/contrib/tcpdump/print-fr.c @@ -463,6 +463,10 @@ mfr_print(netdissect_options *ndo, */ ND_TCHECK2(*p, 4); /* minimum frame header length */ + if (length < 4) { + ND_PRINT((ndo, "Message too short (%u bytes)", length)); + return length; + } if ((p[0] & MFR_BEC_MASK) == MFR_CTRL_FRAME && p[1] == 0) { ND_PRINT((ndo, "FRF.16 Control, Flags [%s], %s, length %u", @@ -499,6 +503,11 @@ mfr_print(netdissect_options *ndo, switch (ie_type) { case MFR_CTRL_IE_MAGIC_NUM: + /* FRF.16.1 Section 3.4.3 Magic Number Information Element */ + if (ie_len != 4) { + ND_PRINT((ndo, "(invalid length)")); + break; + } ND_PRINT((ndo, "0x%08x", EXTRACT_32BITS(tptr))); break; |