diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2003-09-28 23:17:46 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2003-09-28 23:17:46 +0000 |
commit | 962b98cc3919ea12ffd86bc697aa4e3f505812e1 (patch) | |
tree | 05958672c1af6f91bf539cf823eab1b45c2c6b41 /sys | |
parent | ac8974a8de51edc4a7838f60167f279ffe4da0b9 (diff) |
Correct off-by-ones with respect to PRC_NCMDS. Mostly from FreeBSD.
OK krw@, deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/raw_usrreq.c | 4 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 4 | ||||
-rw-r--r-- | sys/netipx/ipx_input.c | 4 | ||||
-rw-r--r-- | sys/netipx/spx_usrreq.c | 4 | ||||
-rw-r--r-- | sys/netiso/cltp_usrreq.c | 4 | ||||
-rw-r--r-- | sys/netiso/if_eon.c | 4 | ||||
-rw-r--r-- | sys/netiso/tp_iso.c | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index ceddb7fe469..67940f882d8 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_usrreq.c,v 1.7 2003/06/02 23:28:12 millert Exp $ */ +/* $OpenBSD: raw_usrreq.c,v 1.8 2003/09/28 23:17:45 cloder Exp $ */ /* $NetBSD: raw_usrreq.c,v 1.11 1996/02/13 22:00:43 christos Exp $ */ /* @@ -139,7 +139,7 @@ raw_ctlinput(cmd, arg, d) void *d; { - if (cmd < 0 || cmd > PRC_NCMDS) + if (cmd < 0 || cmd >= PRC_NCMDS) return NULL; return NULL; /* INCOMPLETE */ diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index fe423a75fb9..ab7d7376f43 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_pcb.c,v 1.35 2003/08/15 20:32:20 tedu Exp $ */ +/* $OpenBSD: in6_pcb.c,v 1.36 2003/09/28 23:17:45 cloder Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -561,7 +561,7 @@ in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify) int errno, nmatch = 0; u_int32_t flowinfo; - if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET6) + if ((unsigned)cmd >= PRC_NCMDS || dst->sa_family != AF_INET6) return 1; sa6_dst = (struct sockaddr_in6 *)dst; diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index d290cd85703..7f187e58962 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_input.c,v 1.15 2003/06/02 23:28:16 millert Exp $ */ +/* $OpenBSD: ipx_input.c,v 1.16 2003/09/28 23:17:45 cloder Exp $ */ /*- * @@ -280,7 +280,7 @@ ipx_ctlinput(cmd, arg_as_sa, dummy) caddr_t arg = (/* XXX */ caddr_t)arg_as_sa; struct ipx_addr *ipx; - if (cmd < 0 || cmd > PRC_NCMDS) + if (cmd < 0 || cmd >= PRC_NCMDS) return NULL; switch (cmd) { struct sockaddr_ipx *sipx; diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 559a27642e7..16f21e8fc65 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spx_usrreq.c,v 1.20 2003/06/02 23:28:16 millert Exp $ */ +/* $OpenBSD: spx_usrreq.c,v 1.21 2003/09/28 23:17:45 cloder Exp $ */ /*- * @@ -612,7 +612,7 @@ spx_ctlinput(cmd, arg_as_sa, dummy) struct ipx_addr *na; struct sockaddr_ipx *sipx; - if (cmd < 0 || cmd > PRC_NCMDS) + if (cmd < 0 || cmd >= PRC_NCMDS) return NULL; switch (cmd) { diff --git a/sys/netiso/cltp_usrreq.c b/sys/netiso/cltp_usrreq.c index e1cca324c8c..35b4cb750e0 100644 --- a/sys/netiso/cltp_usrreq.c +++ b/sys/netiso/cltp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cltp_usrreq.c,v 1.4 2003/06/02 23:28:17 millert Exp $ */ +/* $OpenBSD: cltp_usrreq.c,v 1.5 2003/09/28 23:17:45 cloder Exp $ */ /* $NetBSD: cltp_usrreq.c,v 1.9 1996/02/13 22:08:59 christos Exp $ */ /* @@ -185,7 +185,7 @@ cltp_ctlinput(cmd, sa, dummy) extern u_char inetctlerrmap[]; struct sockaddr_iso *siso; - if ((unsigned) cmd > PRC_NCMDS) + if ((unsigned) cmd >= PRC_NCMDS) return; if (sa->sa_family != AF_ISO && sa->sa_family != AF_CCITT) return; diff --git a/sys/netiso/if_eon.c b/sys/netiso/if_eon.c index 66b5c8f716e..f528387daeb 100644 --- a/sys/netiso/if_eon.c +++ b/sys/netiso/if_eon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_eon.c,v 1.20 2003/07/09 22:03:16 itojun Exp $ */ +/* $OpenBSD: if_eon.c,v 1.21 2003/09/28 23:17:45 cloder Exp $ */ /* $NetBSD: if_eon.c,v 1.15 1996/05/09 22:29:37 scottr Exp $ */ /*- @@ -585,7 +585,7 @@ eonctlinput(cmd, sa, dummy) } #endif - if (cmd < 0 || cmd > PRC_NCMDS) + if (cmd < 0 || cmd >= PRC_NCMDS) return NULL; IncStat(es_icmp[cmd]); diff --git a/sys/netiso/tp_iso.c b/sys/netiso/tp_iso.c index 71a5922952b..72de790e18e 100644 --- a/sys/netiso/tp_iso.c +++ b/sys/netiso/tp_iso.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tp_iso.c,v 1.6 2003/06/02 23:28:18 millert Exp $ */ +/* $OpenBSD: tp_iso.c,v 1.7 2003/09/28 23:17:45 cloder Exp $ */ /* $NetBSD: tp_iso.c,v 1.8 1996/03/16 23:13:54 christos Exp $ */ /*- @@ -649,7 +649,7 @@ tpclnp_ctlinput(cmd, saddr, dummy) } #endif - if (cmd < 0 || cmd > PRC_NCMDS) + if (cmd < 0 || cmd >= PRC_NCMDS) return NULL; if (siso->siso_family != AF_ISO) return NULL; |