summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorho <ho@openbsd.org>2004-01-15 22:59:42 +0000
committerho <ho@openbsd.org>2004-01-15 22:59:42 +0000
commit8ed8b86d3dc138604ec342d38fc17e1250b0a714 (patch)
treeea09c16c5d50b3357e05dda7714df2259f6b471b
parentregression for pthread version of closefrom (diff)
downloadwireguard-openbsd-8ed8b86d3dc138604ec342d38fc17e1250b0a714.tar.xz
wireguard-openbsd-8ed8b86d3dc138604ec342d38fc17e1250b0a714.zip
Input should be atleast an isakmp_header long. otto@, markus@ ok.
-rw-r--r--usr.sbin/tcpdump/print-ike.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/print-ike.c b/usr.sbin/tcpdump/print-ike.c
index bad2b88c2c9..8c4b97b7172 100644
--- a/usr.sbin/tcpdump/print-ike.c
+++ b/usr.sbin/tcpdump/print-ike.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ike.c,v 1.16 2003/12/18 09:14:18 ho Exp $ */
+/* $OpenBSD: print-ike.c,v 1.17 2004/01/15 22:59:42 ho Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -29,7 +29,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-ike.c,v 1.16 2003/12/18 09:14:18 ho Exp $ (XXX)";
+ "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-ike.c,v 1.17 2004/01/15 22:59:42 ho Exp $ (XXX)";
#endif
#include <sys/param.h>
@@ -131,10 +131,9 @@ ike_print (const u_char *cp, u_int length)
#define TCHECK(var, l) if ((u_char *)&(var) > ep - l) goto trunc
ih = (struct isakmp_header *)cp;
- /* Note funny sized packets */
- if (length < 20)
- (void)printf(" [len=%d]", length);
+ if (length < sizeof (struct isakmp_header))
+ goto trunc;
/* 'ep' points to the end of avaible data. */
ep = snapend;