*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.10 2003-07-30 20:34:58 guy Exp $ (LBL)";
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.13 2004-03-24 01:54:29 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
l = EXTRACT_16BITS(&ap->length);
/* XXX ap points to packed struct */
p = (const char *)&ap->length + sizeof(ap->length);
- if (p + l > (const char *)snapend)
- goto trunc;
+ TCHECK2(*p, l);
switch (EXTRACT_32BITS(&ap->family)) {
case 1: /* IPv4 */
+ if (l < 4)
+ return -1;
printf(" %s", ipaddr_string(p));
p += sizeof(struct in_addr);
break;
#ifdef INET6
case 2: /* IPv6 */
+ if (l < 16)
+ return -1;
printf(" %s", ip6addr_string(p));
p += sizeof(struct in6_addr);
break;