From: Francois-Xavier Le Bail Date: Fri, 18 May 2018 09:14:27 +0000 (+0200) Subject: Use more the nd_print_trunc() call X-Git-Tag: tcpdump-4.99-bp~1181 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/a1042c21e59c1543dba39a895a597f5d9e5b2572 Use more the nd_print_trunc() call Update the output of a test accordingly. --- diff --git a/print-ah.c b/print-ah.c index 75baea2e..735226f6 100644 --- a/print-ah.c +++ b/print-ah.c @@ -52,10 +52,7 @@ ah_print(netdissect_options *ndo, const u_char *bp) ND_PRINT(",sumlen=%u", sumlen); ND_TCHECK_4(ah + 1); ND_PRINT(",seq=0x%x", EXTRACT_BE_U_4(ah + 1)); - if (!ND_TTEST_LEN(bp, sizeof(struct ah) + sumlen)) { - ND_PRINT("[truncated]):"); - return -1; - } + ND_TCHECK_LEN(bp, sizeof(struct ah) + sumlen); ND_PRINT("): "); return sizeof(struct ah) + sumlen; diff --git a/tests/heapoverflow-ip_print_demux.out b/tests/heapoverflow-ip_print_demux.out index f97baf99..29aedaa8 100644 --- a/tests/heapoverflow-ip_print_demux.out +++ b/tests/heapoverflow-ip_print_demux.out @@ -3,4 +3,4 @@ 0x0010: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000 0x0020: 3030 00 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto AH (51), length 12336, bad cksum 3030 (->697b)!) - 48.48.48.48 > 48.48.48.48: AH(spi=0x30303030,sumlen=192,seq=0x30303030[truncated]): + 48.48.48.48 > 48.48.48.48: AH(spi=0x30303030,sumlen=192,seq=0x30303030 [|ah]