diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-03-28 00:47:41 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-03-28 00:47:41 +0000 |
commit | 5ddcc378f217dbb5c667f485200c013e60ac7998 (patch) | |
tree | b460e31b1a5988a66e6da2c51b7df591a6951ee2 /usr.sbin/tcpdump/print-domain.c | |
parent | d8ef8d7637bbab8ce96cf7545918e0e6f04a36aa (diff) |
do not core on truncated query-less dns packets; fix pr1746
Diffstat (limited to 'usr.sbin/tcpdump/print-domain.c')
-rw-r--r-- | usr.sbin/tcpdump/print-domain.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-domain.c b/usr.sbin/tcpdump/print-domain.c index 2e6d432bec0..988c1a3c9d2 100644 --- a/usr.sbin/tcpdump/print-domain.c +++ b/usr.sbin/tcpdump/print-domain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-domain.c,v 1.12 2001/03/05 22:40:11 jakob Exp $ */ +/* $OpenBSD: print-domain.c,v 1.13 2001/03/28 00:47:40 mickey Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-domain.c,v 1.12 2001/03/05 22:40:11 jakob Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-domain.c,v 1.13 2001/03/28 00:47:40 mickey Exp $ (LBL)"; #endif #include <sys/param.h> @@ -590,6 +590,8 @@ ns_print(register const u_char *bp, u_int length) /* Print remaining sections on -vv */ if (vflag > 1) { + if (!cp) + goto trunc; if (ancount--) { if ((cp = ns_rprint(cp, bp)) == NULL) goto trunc; |