diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-02-22 01:40:41 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-02-22 01:40:41 +0000 |
commit | 47cc66657083a0ea8fc736859a9e536b5b334439 (patch) | |
tree | 8a7fc51aab33325243ec0007e46c6adca8cac377 | |
parent | 7224416ad8a2fb4aedaf77f9370dadb5b290cef4 (diff) |
be more more picky about ip6 destopt parsing. sync with kame
-rw-r--r-- | sys/netinet6/dest6.c | 7 |
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; } |