cherry-pick.v4.3.1-2-gecee2ace.fix-null-pointer-dereference-get-ipv6-l4proto.patch 897 B

1234567891011121314151617181920212223
  1. Subject: Fix NULL pointer dereference get_ipv6_l4proto()
  2. ID: CVE-2019-8376
  3. Origin: v4.3.1-2-gecee2ace <https://github.com/appneta/tcpreplay/commit/v4.3.1-2-gecee2ace>
  4. Upstream-Author: Gabriel Ganne <gabriel.ganne@mindmaze.ch>
  5. Date: Wed Mar 6 14:31:08 2019 +0100
  6. Bug-Debian: https://bugs.debian.org/922624
  7. get_ipv6_next() returns NULL on malformed packets. If that happens
  8. return the last proto that could be read.
  9. This should fix issue #537
  10. --- a/src/common/get.c
  11. +++ b/src/common/get.c
  12. @@ -536,6 +536,8 @@
  13. case TCPR_IPV6_NH_HBH:
  14. dbgx(3, "Jumping to next extension header (0x%hhx)", proto);
  15. exthdr = get_ipv6_next((struct tcpr_ipv6_ext_hdr_base *)ptr, len);
  16. + if (exthdr == NULL)
  17. + return proto;
  18. proto = exthdr->ip_nh;
  19. ptr = (u_char *)exthdr;
  20. break;