summaryrefslogtreecommitdiff
path: root/print-babel.c
diff options
context:
space:
mode:
Diffstat (limited to 'print-babel.c')
-rw-r--r--print-babel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/print-babel.c b/print-babel.c
index f8741d7..0bb2483 100644
--- a/print-babel.c
+++ b/print-babel.c
@@ -352,6 +352,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;
@@ -480,7 +482,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",