summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2004-01-15 22:59:43 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2004-01-15 22:59:43 +0000
commita84f408acd429632e8259ec4543759057f0a2ef0 (patch)
tree9e29d0fb95aab65fa057a239226437e8761677e0 /usr.sbin
parent876f8ff88fad4264d956d6a129d8eee8015ce5c0 (diff)
Input should be atleast an isakmp_header long. otto@, markus@ ok.
Diffstat (limited to 'usr.sbin')
-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 88ba2202a67..b4f39fff255 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: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-ike.c,v 1.16 2003/12/18 09:14:18 ho Exp $ (XXX)";
+ "@(#) $Header: /cvs/OpenBSD/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;