mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
Fix NULL pointer dereference in the ex_data code
In some circumstances the global data held in the "global" variable can be NULL, so we should error out in the circumstance instead of crashing. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/9035)
This commit is contained in:
parent
57ca171a13
commit
f2d20f0bb8
@ -36,7 +36,7 @@ static EX_CALLBACKS *get_and_lock(OPENSSL_CTX *ctx, int class_index)
|
||||
}
|
||||
|
||||
global = openssl_ctx_get_ex_data_global(ctx);
|
||||
if (global->ex_data_lock == NULL) {
|
||||
if (global == NULL || global->ex_data_lock == NULL) {
|
||||
/*
|
||||
* This can happen in normal operation when using CRYPTO_mem_leaks().
|
||||
* The CRYPTO_mem_leaks() function calls OPENSSL_cleanup() which cleans
|
||||
|
Loading…
Reference in New Issue
Block a user