]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-babel.c
(for 4.9.3) CVE-2018-14880/OSPFv3: Fix a bounds check
[tcpdump] / print-babel.c
index 1a31f2a3cfa3fe17ca087b6f6d1d20f9efe3f883..0bb2483adedbfcf4aa51656039ea290c9647b414 100644 (file)
@@ -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;