Thread: Avoid a NULL dereference after failed initialisation.
authorPauli <paul.dale@oracle.com>
Thu, 21 Nov 2019 03:15:21 +0000 (13:15 +1000)
committerPauli <paul.dale@oracle.com>
Fri, 22 Nov 2019 05:26:33 +0000 (15:26 +1000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10493)

crypto/initthread.c

index da30d59..a5f770e 100644 (file)
@@ -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++) {