summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-11-12 16:07:41 +0000
committerderaadt <deraadt@openbsd.org>2009-11-12 16:07:41 +0000
commit2b7f8517b31dc4c6aaa2611d986bde3d13b1d6c9 (patch)
tree9312f9694533f7d3f94fb5c0c6c6281a17db80ad
parentFix memory leak found by parfait. (diff)
downloadwireguard-openbsd-2b7f8517b31dc4c6aaa2611d986bde3d13b1d6c9.tar.xz
wireguard-openbsd-2b7f8517b31dc4c6aaa2611d986bde3d13b1d6c9.zip
for packets with unknown payloads (outside the range of our knowledge) simply
treat them the same as truncated packets ok sthen
-rw-r--r--usr.sbin/tcpdump/print-ike.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-ike.c b/usr.sbin/tcpdump/print-ike.c
index 7396a9a2a8a..114ffe7746a 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.32 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-ike.c,v 1.33 2009/11/12 16:07:41 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -855,7 +855,9 @@ ike_pl_print (u_int8_t type, u_int8_t *buf, u_int8_t doi)
plprivtypes[type - PAYLOAD_PRIVATE_MIN], this_len);
if ((type < PAYLOAD_RESERVED_MIN &&
- this_len < min_payload_lengths[type]) || this_len == 0)
+ (type < sizeof(min_payload_lengths)/sizeof(min_payload_lengths[0]) &&
+ this_len < min_payload_lengths[type])) ||
+ this_len == 0)
goto pltrunc;
if ((type > PAYLOAD_PRIVATE_MIN && type < PAYLOAD_PRIVATE_MAX &&