summaryrefslogtreecommitdiff
path: root/sys/netinet6/dest6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/dest6.c')
-rw-r--r--sys/netinet6/dest6.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet6/dest6.c b/sys/netinet6/dest6.c
index 63328823a57..eaf0e9e1476 100644
--- a/sys/netinet6/dest6.c
+++ b/sys/netinet6/dest6.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: dest6.c,v 1.7 2001/02/21 17:22:05 itojun Exp $ */
-/* $KAME: dest6.c,v 1.24 2001/02/21 16:12:35 itojun Exp $ */
+/* $OpenBSD: dest6.c,v 1.8 2001/02/22 01:40:40 itojun Exp $ */
+/* $KAME: dest6.c,v 1.25 2001/02/22 01:39:16 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -88,7 +88,8 @@ dest6_input(mp, offp, proto)
/* search header for all options. */
for (optlen = 0; dstoptlen > 0; dstoptlen -= optlen, opt += optlen) {
- if (*opt != IP6OPT_PAD1 && dstoptlen < IP6OPT_MINLEN) {
+ if (*opt != IP6OPT_PAD1 &&
+ (dstoptlen < IP6OPT_MINLEN || *(opt + 1) + 2 > dstoptlen)) {
ip6stat.ip6s_toosmall++;
goto bad;
}