From: Vincent Bernat Date: Sat, 17 Jan 2015 14:49:52 +0000 (+0100) Subject: lldp: fix boundary checks when decoding LLDP protocol identity X-Git-Tag: 0.7.14~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e82fcf01cc98113a962721036c81c1282a3684;p=thirdparty%2Flldpd.git lldp: fix boundary checks when decoding LLDP protocol identity --- 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 "