From 78e82fcf01cc98113a962721036c81c1282a3684 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 17 Jan 2015 15:49:52 +0100 Subject: [PATCH] lldp: fix boundary checks when decoding LLDP protocol identity --- src/daemon/lldp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemon/lldp.c b/src/daemon/lldp.c index 7dcfabf2..0d68e5de 100644 --- a/src/daemon/lldp.c +++ b/src/daemon/lldp.c @@ -805,7 +805,7 @@ lldp_decode(struct lldpd *cfg, char *frame, int s, goto malformed; } pi->p_pi_len = PEEK_UINT8; - CHECK_TLV_SIZE(1 + pi->p_pi_len, "PI"); + CHECK_TLV_SIZE(5 + pi->p_pi_len, "PI"); if ((pi->p_pi = (char *)calloc(1, pi->p_pi_len)) == NULL) { log_warn("lldp", "unable to alloc pid name for " -- 2.39.5