fix out-of-bounds check in lock_dbg_cb (was too lose to detect all

invalid cases)

PR: 674
This commit is contained in:
Bodo Möller 2003-08-14 10:33:56 +00:00
parent 643ecd2ed6
commit 563c05e2dc
2 changed files with 2 additions and 2 deletions

View 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;

View 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;