fix out-of-bounds check in lock_dbg_cb (was too lose to detect all
authorBodo Möller <bodo@openssl.org>
Thu, 14 Aug 2003 10:33:56 +0000 (10:33 +0000)
committerBodo Möller <bodo@openssl.org>
Thu, 14 Aug 2003 10:33:56 +0000 (10:33 +0000)
invalid cases)

PR: 674

apps/openssl.c
ssl/ssltest.c

index 45af2ba7f9a8281afcb7ab527a82941deba867b0..e0d89d4ab413fee3c8c22ee62d96b6f687227c2b 100644 (file)
@@ -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;
index a304398b9f6930ccecec294df00731d5b0cc7fe1..7bb4152000cf4bb5c24409c1b9af4e917243bdc2 100644 (file)
@@ -303,7 +303,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;