From: Pauli Date: Thu, 21 Nov 2019 03:15:21 +0000 (+1000) Subject: Thread: Avoid a NULL dereference after failed initialisation. X-Git-Tag: openssl-3.0.0-alpha1~915 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3478a2102e8bfc63f20e22826ab39b407ff43f62;p=oweals%2Fopenssl.git Thread: Avoid a NULL dereference after failed initialisation. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10493) --- 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++) {