diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-08-24 12:52:56 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-09-05 15:41:31 +1000 |
commit | 59ed73398920a9ad663da03a08cfd290995f55af (patch) | |
tree | bccad4938bb16ff273f3511be04fdda7fb4ac900 /crypto/initthread.c | |
parent | 5340c8ea2a25d17ee2ce1f35d1fb545b8487e84b (diff) |
Fix coverity CID #1454815 - NULL ptr dereference in initthread.c
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/12708)
Diffstat (limited to 'crypto/initthread.c')
-rw-r--r-- | crypto/initthread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/initthread.c b/crypto/initthread.c index c9a34a77db..5ad38dfee2 100644 --- a/crypto/initthread.c +++ b/crypto/initthread.c @@ -392,13 +392,14 @@ static int init_thread_deregister(void *index, int all) for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) { THREAD_EVENT_HANDLER **hands = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i); - THREAD_EVENT_HANDLER *curr = *hands, *prev = NULL, *tmp; + THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp; if (hands == NULL) { if (!all) CRYPTO_THREAD_unlock(gtr->lock); return 0; } + curr = *hands; while (curr != NULL) { if (all || curr->index == index) { if (prev != NULL) |