Off-by-one-error corrected.
[openssl.git] / crypto / cryptlib.c
index e16bbc6626c2f4579abac200dd2cbd4f4283b187..26c1da7074f985802a3192827d7ce227b6aae1e7 100644 (file)
@@ -523,7 +523,7 @@ const char *CRYPTO_get_lock_name(int type)
                return("dynamic");
        else if (type < CRYPTO_NUM_LOCKS)
                return(lock_names[type]);
-       else if (type-CRYPTO_NUM_LOCKS >= sk_num(app_locks))
+       else if (type-CRYPTO_NUM_LOCKS > sk_num(app_locks))
                return("ERROR");
        else
                return(sk_value(app_locks,type-CRYPTO_NUM_LOCKS));