X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/8b250cbf6f97792950ae756b86eae99fba2af0f5..f662dad02b51b595592df9fa6b0884e438cef9a3:/tcpdump.c diff --git a/tcpdump.c b/tcpdump.c index cdfba892..88295d84 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -1720,6 +1720,11 @@ print_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp) hdrlen = (*print_info->p.printer)(h, sp); } + /* + * Restore the original snapend, as a printer might have + * changed it. + */ + snapend = sp + h->caplen; if (Xflag) { /* * Print the raw packet data in hex and ASCII.