summaryrefslogtreecommitdiff
path: root/proto_lldp.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto_lldp.c')
-rw-r--r--proto_lldp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/proto_lldp.c b/proto_lldp.c
index 889169a..3d1e8bf 100644
--- a/proto_lldp.c
+++ b/proto_lldp.c
@@ -399,11 +399,15 @@ static void lldp(struct pkt_buff *pkt)
}
tlv_info_str++;
+
+ if (tlv_len - mgmt_alen < sizeof(uint32_t))
+ goto out_invalid;
tprintf(", Iface Number %u", EXTRACT_32BIT(tlv_info_str));
tlv_info_str += 4;
mgmt_oidlen = *tlv_info_str;
- if (tlv_len - mgmt_alen - sizeof(uint32_t) - 3 < mgmt_oidlen)
+ if (tlv_len - mgmt_alen - sizeof(uint32_t) < 3 ||
+ tlv_len - mgmt_alen - sizeof(uint32_t) - 3 < mgmt_oidlen)
goto out_invalid;
if (mgmt_oidlen > 0) {
tprintf(", OID ");
nux/net-next.git/diff/?h=nds-private-remove&id=35eeacf1820a08305c2b0960febfa190f5a6dd63'>Diffstat (limited to 'include/net/9p/9p.h')