DNS: Use ND_TCHECK_LEN() instead of a custom bounds check
This avoids an invalid-pointer-pair AddressSanitizer error.
Add a test file.
The error was:
reading from file ppp_ip_udp_dns.pcap, link-type PPP_SERIAL(PPP over
serial), snapshot length
2098998
=================================================================
==258093==ERROR: AddressSanitizer: invalid-pointer-pair: 0x61300000c086
0x61300000019e
#0 0x78274f in ns_rprint [...]/print-domain.c:728:9
Address 0x61300000c086 is a wild pointer inside of access range of size
0x000000000001.
0x61300000019e is located 0 bytes after 350-byte region
[0x613000000040,0x61300000019e)
allocated by thread T0 here:
#0 0x4b997e in malloc ([...]/tcpdump+0x4b997e)
#1 0x60220b in ppp_hdlc [...]/print-ppp.c:1367:16
SUMMARY: AddressSanitizer: invalid-pointer-pair
[...]/print-domain.c:728:9 in ns_rprint