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 45af2ba..e0d89d4 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 a304398..7bb4152 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;