summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2003-09-11 21:40:21 +0000
committerru <ru@FreeBSD.org>2003-09-11 21:40:21 +0000
commit27c75c8f21b68a051100fcfb4c1ead51af82f27c (patch)
tree2e5bc0c5a4abec88fce26400f3a3a2ad0823f9cd /sys/netinet/tcp_subr.c
parent1ea5197e3f7af28d45665d66279ded2085a9556c (diff)
downloadFreeBSD-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/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c4
1 files changed, 2 insertions, 2 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. */
OpenPOWER on IntegriCloud