diff options
-rw-r--r-- | lib/libpthread/uthread/uthread_sigaction.c | 4 | ||||
-rw-r--r-- | lib/libssl/src/apps/openssl.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/ssltest.c | 2 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/ssh.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/dart.c | 20 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/ssh.c | 4 | ||||
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/machdep.c | 4 | ||||
-rw-r--r-- | sys/netns/ns_input.c | 4 | ||||
-rw-r--r-- | sys/netns/spp_usrreq.c | 4 | ||||
-rw-r--r-- | usr.bin/nc/netcat.c | 4 | ||||
-rw-r--r-- | usr.bin/pmdb/signal.c | 4 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/sig.c | 4 |
13 files changed, 32 insertions, 32 deletions
diff --git a/lib/libpthread/uthread/uthread_sigaction.c b/lib/libpthread/uthread/uthread_sigaction.c index a7dff2a98cb..ef01871360e 100644 --- a/lib/libpthread/uthread/uthread_sigaction.c +++ b/lib/libpthread/uthread/uthread_sigaction.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_sigaction.c,v 1.7 2003/01/31 04:46:17 marc Exp $ */ +/* $OpenBSD: uthread_sigaction.c,v 1.8 2003/09/22 21:39:35 miod Exp $ */ /* * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> * All rights reserved. @@ -45,7 +45,7 @@ sigaction(int sig, const struct sigaction * act, struct sigaction * oact) struct sigaction gact; /* Check if the signal number is out of range: */ - if (sig < 1 || sig > NSIG) { + if (sig < 1 || sig >= NSIG) { /* Return an invalid argument: */ errno = EINVAL; ret = -1; diff --git a/lib/libssl/src/apps/openssl.c b/lib/libssl/src/apps/openssl.c index 45af2ba7f9a..e0d89d4ab41 100644 --- a/lib/libssl/src/apps/openssl.c +++ b/lib/libssl/src/apps/openssl.c @@ -163,7 +163,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line) goto err; } - if (type < 0 || type > CRYPTO_NUM_LOCKS) + if (type < 0 || type >= CRYPTO_NUM_LOCKS) { errstr = "type out of bounds"; goto err; diff --git a/lib/libssl/src/ssl/ssltest.c b/lib/libssl/src/ssl/ssltest.c index 5fccc48b717..84c25d2c30a 100644 --- a/lib/libssl/src/ssl/ssltest.c +++ b/lib/libssl/src/ssl/ssltest.c @@ -291,7 +291,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line) goto err; } - if (type < 0 || type > CRYPTO_NUM_LOCKS) + if (type < 0 || type >= CRYPTO_NUM_LOCKS) { errstr = "type out of bounds"; goto err; diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index ab270e65b2a..12749553eb9 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.54 2003/07/14 18:56:12 drahn Exp $ */ +/* $OpenBSD: machdep.c,v 1.55 2003/09/22 21:39:38 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -1465,7 +1465,7 @@ nameinterrupt(replace, newstr) extern char intrnames[]; extern char eintrnames[]; - if (replace > NENTRIES) { + if (replace >= NENTRIES) { return; } src = intrnames; diff --git a/sys/arch/mvme68k/dev/ssh.c b/sys/arch/mvme68k/dev/ssh.c index bc09863d33c..9f140983bde 100644 --- a/sys/arch/mvme68k/dev/ssh.c +++ b/sys/arch/mvme68k/dev/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.5 2003/06/02 23:27:50 millert Exp $ */ +/* $OpenBSD: ssh.c,v 1.6 2003/09/22 21:39:39 miod Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -1054,7 +1054,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status) n = (n - Ent_dataout) / 16; else n = (n - Ent_datain) / 16; - if (n <= 0 && n > DMAMAXIO) + if (n <= 0 || n >= DMAMAXIO) printf("TEMP invalid %d\n", n); else { acb->iob_curbuf = (u_long)acb->ds.chain[n].databuf; diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c index d77823831b0..5bdd8644add 100644 --- a/sys/arch/mvme88k/dev/dart.c +++ b/sys/arch/mvme88k/dev/dart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dart.c,v 1.21 2003/08/21 21:48:23 miod Exp $ */ +/* $OpenBSD: dart.c,v 1.22 2003/09/22 21:39:39 miod Exp $ */ /* * Mach Operating System @@ -169,7 +169,7 @@ darttty(dev) struct dartsoftc *sc; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (NULL); sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -321,7 +321,7 @@ dartstart(tp) dev = tp->t_dev; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return; sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -446,7 +446,7 @@ dartmctl (dev, flags, how) int s; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -555,7 +555,7 @@ dartioctl(dev, cmd, data, flag, p) struct dartsoftc *sc; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -648,7 +648,7 @@ dartparam(tp, t) dev = tp->t_dev; dprintf(("dartparam: setting param for dev(%d, %d)\n", major(dev), minor(dev))); port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -822,7 +822,7 @@ dartopen (dev, flag, mode, p) struct tty *tp; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); sc = (struct dartsoftc *) dart_cd.cd_devs[0]; /* the only one */ @@ -885,7 +885,7 @@ dartclose (dev, flag, mode, p) int port; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -909,7 +909,7 @@ dartread (dev, uio, flag) struct dartsoftc *sc; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); sc = (struct dartsoftc *) dart_cd.cd_devs[0]; @@ -933,7 +933,7 @@ dartwrite(dev, uio, flag) struct dartsoftc *sc; port = DART_PORT(dev); - if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) + if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); sc = (struct dartsoftc *)dart_cd.cd_devs[0]; diff --git a/sys/arch/mvme88k/dev/ssh.c b/sys/arch/mvme88k/dev/ssh.c index 9e8bd9fe18d..d47a7f8d869 100644 --- a/sys/arch/mvme88k/dev/ssh.c +++ b/sys/arch/mvme88k/dev/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.14 2003/06/02 23:27:52 millert Exp $ */ +/* $OpenBSD: ssh.c,v 1.15 2003/09/22 21:39:39 miod Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -1193,7 +1193,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status) n = (n - Ent_dataout) / 16; else n = (n - Ent_datain) / 16; - if (n <= 0 && n > DMAMAXIO) + if (n <= 0 || n >= DMAMAXIO) printf("TEMP invalid %d\n", n); else { acb->iob_curbuf = (u_long)acb->ds.chain[n].databuf; diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c index ac7b0f6a8a9..b5dbeea5552 100644 --- a/sys/arch/mvmeppc/mvmeppc/machdep.c +++ b/sys/arch/mvmeppc/mvmeppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.32 2003/08/06 21:08:06 millert Exp $ */ +/* $OpenBSD: machdep.c,v 1.33 2003/09/22 21:39:40 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -1400,7 +1400,7 @@ nameinterrupt(replace, newstr) extern char intrnames[]; extern char eintrnames[]; - if (replace > NENTRIES) { + if (replace >= NENTRIES) { return; } src = intrnames; diff --git a/sys/netns/ns_input.c b/sys/netns/ns_input.c index d63cc9a74f2..efc01c1d6d3 100644 --- a/sys/netns/ns_input.c +++ b/sys/netns/ns_input.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ns_input.c,v 1.4 2003/06/02 23:28:19 millert Exp $ */ +/* $OpenBSD: ns_input.c,v 1.5 2003/09/22 21:39:40 miod Exp $ */ /* $NetBSD: ns_input.c,v 1.9 1996/02/13 22:13:56 christos Exp $ */ /* @@ -262,7 +262,7 @@ idp_ctlinput(cmd, sa, arg) struct ns_errp *errp = NULL; int type; - if (cmd < 0 || cmd > PRC_NCMDS) + if (cmd < 0 || cmd >= PRC_NCMDS) return NULL; if (nsctlerrmap[cmd] == 0) return NULL; /* XXX */ diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c index 49c256df2e1..5728a4129bb 100644 --- a/sys/netns/spp_usrreq.c +++ b/sys/netns/spp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spp_usrreq.c,v 1.15 2003/06/02 23:28:19 millert Exp $ */ +/* $OpenBSD: spp_usrreq.c,v 1.16 2003/09/22 21:39:40 miod Exp $ */ /* $NetBSD: spp_usrreq.c,v 1.9 1996/02/13 22:14:13 christos Exp $ */ /* @@ -596,7 +596,7 @@ spp_ctlinput(cmd, sa, arg) struct sockaddr_ns *sns; int type; - if (cmd < 0 || cmd > PRC_NCMDS) + if (cmd < 0 || cmd >= PRC_NCMDS) return NULL; type = NS_ERR_UNREACH_HOST; diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c index 06871179c04..edf26866073 100644 --- a/usr.bin/nc/netcat.c +++ b/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.62 2003/07/25 21:35:16 millert Exp $ */ +/* $OpenBSD: netcat.c,v 1.63 2003/09/22 21:39:40 miod Exp $ */ /* * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> * @@ -74,7 +74,7 @@ int zflag; /* Port Scan Flag */ int timeout = -1; int family = AF_UNSPEC; -char *portlist[PORT_MAX]; +char *portlist[PORT_MAX+1]; ssize_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); void atelnet(int, unsigned char *, unsigned int); diff --git a/usr.bin/pmdb/signal.c b/usr.bin/pmdb/signal.c index 6ed78535514..92f8af0efd4 100644 --- a/usr.bin/pmdb/signal.c +++ b/usr.bin/pmdb/signal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signal.c,v 1.3 2002/06/26 13:21:25 todd Exp $ */ +/* $OpenBSD: signal.c,v 1.4 2003/09/22 21:39:40 miod Exp $ */ /* * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -107,7 +107,7 @@ cmd_signal_ignore(int argc, char **argv, void *arg) } l = strtol(signame, &ep, 0); - if (signame[0] == '\0' || *ep != '\0' || l < 1 || l > NSIG) { + if (signame[0] == '\0' || *ep != '\0' || l < 1 || l >= NSIG) { if (!strncmp("SIG", signame, 3)) signame += 3; for (signum = 1; signum < NSIG; signum++) { diff --git a/usr.sbin/ppp/ppp/sig.c b/usr.sbin/ppp/ppp/sig.c index faa647a1e8d..00c1288406f 100644 --- a/usr.sbin/ppp/ppp/sig.c +++ b/usr.sbin/ppp/ppp/sig.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: sig.c,v 1.7 2002/06/15 01:33:23 brian Exp $ + * $OpenBSD: sig.c,v 1.8 2003/09/22 21:39:40 miod Exp $ */ #include <sys/types.h> @@ -65,7 +65,7 @@ sig_signal(int sig, sig_type fn) { sig_type Result; - if (sig <= 0 || sig > NSIG) { + if (sig <= 0 || sig >= NSIG) { /* Oops - we must be a bit out of date (too many sigs ?) */ log_Printf(LogALERT, "Eeek! %s:%d: I must be out of date!\n", __FILE__, __LINE__); |