0001-daemon-fix-read-overflow-when-parsing-CDP-addresses.patch 953 B

123456789101112131415161718192021222324
  1. From a9aeabdf879c25c584852a0bb5523837632f099b Mon Sep 17 00:00:00 2001
  2. From: Vincent Bernat <vincent@bernat.ch>
  3. Date: Wed, 12 Apr 2023 07:38:31 +0200
  4. Subject: [PATCH] daemon: fix read overflow when parsing CDP addresses
  5. Upstream: https://github.com/lldpd/lldpd/commit/a9aeabdf879c25c584852a0bb5523837632f099b
  6. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  7. ---
  8. NEWS | 4 ++++
  9. src/daemon/protocols/cdp.c | 1 +
  10. 2 files changed, 5 insertions(+)
  11. diff --git a/src/daemon/protocols/cdp.c b/src/daemon/protocols/cdp.c
  12. index 8a1be863..42861c0e 100644
  13. --- a/src/daemon/protocols/cdp.c
  14. +++ b/src/daemon/protocols/cdp.c
  15. @@ -466,6 +466,7 @@ cdp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardwar
  16. goto malformed;
  17. }
  18. PEEK_DISCARD(address_len);
  19. + addresses_len -= address_len;
  20. (void)PEEK_SAVE(pos_next_address);
  21. /* Next, we go back and try to extract
  22. IPv4 address */