summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhartmei <dhartmei@openbsd.org>2002-11-28 11:05:06 +0000
committerdhartmei <dhartmei@openbsd.org>2002-11-28 11:05:06 +0000
commita4dec6b74293039250557ed46a2a518417e4af2c (patch)
tree1321e8f5fbda5be353a7e4c521cc5a2aeeaf50c9
parentUse any existing hostname as the default, as the install could have (diff)
downloadwireguard-openbsd-a4dec6b74293039250557ed46a2a518417e4af2c.tar.xz
wireguard-openbsd-a4dec6b74293039250557ed46a2a518417e4af2c.zip
Check for invalid ICMP6 option length, ok itojun@
-rw-r--r--usr.sbin/tcpdump/print-icmp6.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/print-icmp6.c b/usr.sbin/tcpdump/print-icmp6.c
index 220f3397708..ee7528af48d 100644
--- a/usr.sbin/tcpdump/print-icmp6.c
+++ b/usr.sbin/tcpdump/print-icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-icmp6.c,v 1.3 2002/05/30 18:36:42 deraadt Exp $ */
+/* $OpenBSD: print-icmp6.c,v 1.4 2002/11/28 11:05:06 dhartmei Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994
@@ -449,6 +449,10 @@ icmp6_opt_print(register const u_char *bp, int resid)
ECHECK(op->nd_opt_len);
if (resid <= 0)
return;
+ if (op->nd_opt_len == 0)
+ goto trunc;
+ if (bp + (op->nd_opt_len << 3) > ep)
+ goto trunc;
switch (op->nd_opt_type) {
case ND_OPT_SOURCE_LINKADDR:
opl = (struct nd_opt_hdr *)op;