aboutsummaryrefslogtreecommitdiffstats
path: root/print-fr.c
diff options
context:
space:
mode:
Diffstat (limited to 'print-fr.c')
-rw-r--r--print-fr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/print-fr.c b/print-fr.c
index 7181eb486e49..8a1a53a4914b 100644
--- a/print-fr.c
+++ b/print-fr.c
@@ -457,6 +457,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",
@@ -493,6 +497,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;