File: 0002-daemon-fix-read-overflow-when-parsing-CDP-addresses.patch

package info (click to toggle)
lldpd 1.0.16-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,528 kB
  • sloc: ansic: 90,221; sh: 5,081; python: 1,397; makefile: 647; awk: 19
file content (26 lines) | stat: -rw-r--r-- 911 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Vincent Bernat <vincent@bernat.ch>
Date: Wed, 12 Apr 2023 07:38:31 +0200
Subject: daemon: fix read overflow when parsing CDP addresses
Origin: https://github.com/lldpd/lldpd/commit/a9aeabdf879c25c584852a0bb5523837632f099b
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2023-41910

---
 NEWS                       | 4 ++++
 src/daemon/protocols/cdp.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/daemon/protocols/cdp.c b/src/daemon/protocols/cdp.c
index 8a1be86362fc..42861c0e9514 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.40.1