diff options
author | ru <ru@FreeBSD.org> | 2003-09-11 21:40:21 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2003-09-11 21:40:21 +0000 |
commit | 27c75c8f21b68a051100fcfb4c1ead51af82f27c (patch) | |
tree | 2e5bc0c5a4abec88fce26400f3a3a2ad0823f9cd /sys/netinet | |
parent | 1ea5197e3f7af28d45665d66279ded2085a9556c (diff) | |
download | FreeBSD-src-27c75c8f21b68a051100fcfb4c1ead51af82f27c.zip FreeBSD-src-27c75c8f21b68a051100fcfb4c1ead51af82f27c.tar.gz |
Fix a bunch of off-by-one errors in the range checking code.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 26aa1a6..6a176f3 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1138,7 +1138,7 @@ tcp_ctlinput(cmd, sa, vip) notify = in_rtchange; } else if (cmd == PRC_HOSTDEAD) ip = 0; - else if ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0) + else if ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0) return; if (ip) { s = splnet(); @@ -1204,7 +1204,7 @@ tcp6_ctlinput(cmd, sa, d) else if (cmd == PRC_MSGSIZE) notify = tcp_mtudisc; else if (!PRC_IS_REDIRECT(cmd) && - ((unsigned)cmd > PRC_NCMDS || inet6ctlerrmap[cmd] == 0)) + ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0)) return; /* if the parameter is from icmp6, decode it. */ diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 26aa1a6..6a176f3 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -1138,7 +1138,7 @@ tcp_ctlinput(cmd, sa, vip) notify = in_rtchange; } else if (cmd == PRC_HOSTDEAD) ip = 0; - else if ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0) + else if ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0) return; if (ip) { s = splnet(); @@ -1204,7 +1204,7 @@ tcp6_ctlinput(cmd, sa, d) else if (cmd == PRC_MSGSIZE) notify = tcp_mtudisc; else if (!PRC_IS_REDIRECT(cmd) && - ((unsigned)cmd > PRC_NCMDS || inet6ctlerrmap[cmd] == 0)) + ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0)) return; /* if the parameter is from icmp6, decode it. */ |