};
/* 1 byte type and 1-byte length */
-#define JUNIPER_EXT_TLV_OVERHEAD 2
+#define JUNIPER_EXT_TLV_OVERHEAD 2U
static const struct tok jnx_ext_tlv_values[] = {
{ JUNIPER_EXT_TLV_IFD_IDX, "Device Interface Index" },
tlv_len = *(tptr++);
tlv_value = 0;
- /* sanity check */
+ /* sanity checks */
if (tlv_type == 0 || tlv_len == 0)
break;
+ if (tlv_len+JUNIPER_EXT_TLV_OVERHEAD > jnx_ext_len)
+ goto trunc;
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "\n\t %s Extension TLV #%u, length %u, value ",
stp-heapoverflow-4 stp-heapoverflow-4.pcap stp-heapoverflow-4.out -t -v -n
stp-heapoverflow-5 stp-heapoverflow-5.pcap stp-heapoverflow-5.out -t -v -n
arp-too-long-tha arp-too-long-tha.pcap arp-too-long-tha.out -t -v -n
+juniper_header-heapoverflow juniper_header-heapoverflow.pcap juniper_header-heapoverflow.out -t -v -n