summaryrefslogtreecommitdiffstats
path: root/freebsd/contrib/tcpdump/print-babel.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/contrib/tcpdump/print-babel.c')
-rw-r--r--freebsd/contrib/tcpdump/print-babel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/freebsd/contrib/tcpdump/print-babel.c b/freebsd/contrib/tcpdump/print-babel.c
index de549fd4..279291f6 100644
--- a/freebsd/contrib/tcpdump/print-babel.c
+++ b/freebsd/contrib/tcpdump/print-babel.c
@@ -358,6 +358,8 @@ babel_print_v2(netdissect_options *ndo,
goto invalid;
bodylen = EXTRACT_16BITS(cp + 2);
ND_PRINT((ndo, " (%u)", bodylen));
+ if (4U + bodylen > length)
+ goto invalid;
/* Process the TLVs in the body */
i = 0;
@@ -486,7 +488,7 @@ babel_print_v2(netdissect_options *ndo,
case MESSAGE_UPDATE: {
if (!ndo->ndo_vflag) {
ND_PRINT((ndo, " update"));
- if(len < 1)
+ if(len < 10)
ND_PRINT((ndo, "/truncated"));
else
ND_PRINT((ndo, "%s%s%s",