From 3478a2102e8bfc63f20e22826ab39b407ff43f62 Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 21 Nov 2019 13:15:21 +1000 Subject: [PATCH] Thread: Avoid a NULL dereference after failed initialisation. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10493) --- crypto/initthread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/initthread.c b/crypto/initthread.c index da30d59fec..a5f770e200 100644 --- a/crypto/initthread.c +++ b/crypto/initthread.c @@ -380,6 +380,8 @@ static int init_thread_deregister(void *index, int all) int i; gtr = get_global_tevent_register(); + if (gtr == NULL) + return 0; if (!all) CRYPTO_THREAD_write_lock(gtr->lock); for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) { -- 2.25.1