]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lldp.c
Handle very large -f files by rejecting them.
[tcpdump] / print-lldp.c
index 3984a4f58b6794fcca0bd98d1da3e1f9c63f438e..e87b16bd0fcc16444599148d7e4f029298a0be30 100644 (file)
@@ -898,6 +898,9 @@ lldp_private_8023_print(netdissect_options *ndo,
         break;
 
     case LLDP_PRIVATE_8023_SUBTYPE_MTU:
+        if (tlv_len < 6) {
+            return hexdump;
+        }
         ND_PRINT((ndo, "\n\t    MTU size %u", EXTRACT_16BITS(tptr + 4)));
         break;
 
@@ -927,7 +930,7 @@ lldp_extract_latlon(const u_char *tptr)
  * (right now there is only one)
  */
 
+
 static int
 lldp_private_iana_print(netdissect_options *ndo,
                         const u_char *tptr, u_int tlv_len)
@@ -951,12 +954,12 @@ lldp_private_iana_print(netdissect_options *ndo,
     default:
         hexdump=TRUE;
     }
-    
+
     return hexdump;
 }
 
 
-      
+
 /*
  * Print private TIA extensions.
  */