From d7092c66f5a4c3ecd743c01aaca08c721d742a19 Mon Sep 17 00:00:00 2001 From: miod <> Date: Mon, 22 Sep 2003 21:39:40 +0000 Subject: Off-by-ones, from aaron@ --- src/lib/libssl/src/apps/openssl.c | 2 +- src/lib/libssl/src/ssl/ssltest.c | 2 +- src/usr.bin/nc/netcat.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/libssl/src/apps/openssl.c b/src/lib/libssl/src/apps/openssl.c index 45af2ba7f9..e0d89d4ab4 100644 --- a/src/lib/libssl/src/apps/openssl.c +++ b/src/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/src/lib/libssl/src/ssl/ssltest.c b/src/lib/libssl/src/ssl/ssltest.c index 5fccc48b71..84c25d2c30 100644 --- a/src/lib/libssl/src/ssl/ssltest.c +++ b/src/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/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 06871179c0..edf2686607 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/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 * @@ -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); -- cgit v1.2.3-55-g6feb