Make CRYPTO_num_locks() return 1

malloc(0) might return NULL and code for the old callbacks might fail,
instead just say they should allocate 1 entry.

Reviewed-by: Matt Caswell <matt@openssl.org>

GH: #1266
This commit is contained in:
Kurt Roeckx 2016-06-29 11:46:39 +02:00
parent 152d264616
commit 453bff2267

View File

@ -215,7 +215,7 @@ void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
* On the other hand, the locking callbacks are no longer used. Consequently, * On the other hand, the locking callbacks are no longer used. Consequently,
* the callback management functions can be safely replaced with no-op macros. * the callback management functions can be safely replaced with no-op macros.
*/ */
# define CRYPTO_num_locks() (0) # define CRYPTO_num_locks() (1)
# define CRYPTO_set_locking_callback(func) # define CRYPTO_set_locking_callback(func)
# define CRYPTO_get_locking_callback() (NULL) # define CRYPTO_get_locking_callback() (NULL)
# define CRYPTO_set_add_lock_callback(func) # define CRYPTO_set_add_lock_callback(func)