From f86fd5a6747c86e1c823c71949efe46b9146d138 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 1 Mar 2018 14:04:56 +0100 Subject: UDP: Fix the uses of the pointer to the end of current packet Must be based on packet header caplen. --- print-udp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'print-udp.c') diff --git a/print-udp.c b/print-udp.c index 2bb5eac5..8c558cf5 100644 --- a/print-udp.c +++ b/print-udp.c @@ -386,12 +386,10 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, const struct udphdr *up; const struct ip *ip; const u_char *cp; - const u_char *ep = bp + length; + const u_char *ep = ndo->ndo_snapend; uint16_t sport, dport, ulen; const struct ip6_hdr *ip6; - if (ep > ndo->ndo_snapend) - ep = ndo->ndo_snapend; up = (const struct udphdr *)bp; ip = (const struct ip *)bp2; if (IP_V(ip) == 6) -- cgit v1.2.1