From a9aeabdf879c25c584852a0bb5523837632f099b Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 12 Apr 2023 07:38:31 +0200 Subject: [PATCH] daemon: fix read overflow when parsing CDP addresses --- NEWS | 4 ++++ src/daemon/protocols/cdp.c | 1 + 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index 003325ae..ffc8e804 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +lldpd (1.0.17) + * Fix: + + Read overflow when parsing CDP addresses. Thanks to Matteo Memelli. + lldpd (1.0.16) * Fix: + Do not use 00:00:00:00:00:00 as chassis ID. diff --git a/src/daemon/protocols/cdp.c b/src/daemon/protocols/cdp.c index 8a1be863..42861c0e 100644 --- a/src/daemon/protocols/cdp.c +++ b/src/daemon/protocols/cdp.c @@ -466,6 +466,7 @@ cdp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardwar goto malformed; } PEEK_DISCARD(address_len); + addresses_len -= address_len; (void)PEEK_SAVE(pos_next_address); /* Next, we go back and try to extract IPv4 address */ -- 2.39.5