From b6f0f546ff06fa9aa7e37c1a272e3a712c81fdc0 Mon Sep 17 00:00:00 2001 From: Pauli Date: Wed, 17 Mar 2021 12:59:24 +1000 Subject: async: coverity 1446224 - dereference after null check Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/14589) --- crypto/async/async.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crypto/async/async.c b/crypto/async/async.c index 2a51ee7bc2..53b25d7b4b 100644 --- a/crypto/async/async.c +++ b/crypto/async/async.c @@ -181,7 +181,7 @@ int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *wctx, int *ret, if (ctx == NULL) return ASYNC_ERR; - if (*job) + if (*job != NULL) ctx->currjob = *job; for (;;) { @@ -203,7 +203,10 @@ int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *wctx, int *ret, } if (ctx->currjob->status == ASYNC_JOB_PAUSED) { + if (*job == NULL) + return ASYNC_ERR; ctx->currjob = *job; + /* * Restore the default libctx to what it was the last time the * fibre ran -- cgit v1.2.3