summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-ip6.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2007-05-06 09:51:33 +0000
committerclaudio <claudio@openbsd.org>2007-05-06 09:51:33 +0000
commit8119d9e9e646bc1c83b8d7d2cf14fef175ceca13 (patch)
tree02e7478fa634fc29c1a1d202063174327741749b /usr.sbin/tcpdump/print-ip6.c
parentpoint the macros for the interrupt coalescing registers at the right (diff)
downloadwireguard-openbsd-8119d9e9e646bc1c83b8d7d2cf14fef175ceca13.tar.xz
wireguard-openbsd-8119d9e9e646bc1c83b8d7d2cf14fef175ceca13.zip
Fix the out of bounds check when parsing IPv6 headers. Fixes a SIGSEGV
when parsing IPv6 headers with unknown or corrupted header options. OK henning@ mcbride@
Diffstat (limited to 'usr.sbin/tcpdump/print-ip6.c')
-rw-r--r--usr.sbin/tcpdump/print-ip6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c
index d7465fba090..fa343a1fe69 100644
--- a/usr.sbin/tcpdump/print-ip6.c
+++ b/usr.sbin/tcpdump/print-ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ip6.c,v 1.7 2006/09/19 14:25:04 naddy Exp $ */
+/* $OpenBSD: print-ip6.c,v 1.8 2007/05/06 09:51:33 claudio Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
@@ -113,7 +113,7 @@ ip6_print(register const u_char *bp, register int length)
cp = (const u_char *)ip6;
nh = ip6->ip6_nxt;
- while (cp < snapend) {
+ while (cp + hlen < snapend) {
cp += hlen;
if (cp == (u_char *)(ip6 + 1) &&