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:26 +0000 (10:33 +0000)
committerBodo Möller <bodo@openssl.org>
Thu, 14 Aug 2003 10:33:26 +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 47c383200ae62cdf3850db1afe6125032346a061..42289c255b27e00328bf2c5e11fac788f801e02d 100644 (file)
@@ -290,7 +290,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;