From: Pauli Date: Wed, 17 Mar 2021 02:59:24 +0000 (+1000) Subject: async: coverity 1446224 - dereference after null check X-Git-Tag: openssl-3.0.0-alpha14~183 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6f0f546ff06fa9aa7e37c1a272e3a712c81fdc0;p=thirdparty%2Fopenssl.git async: coverity 1446224 - dereference after null check Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/14589) --- diff --git a/crypto/async/async.c b/crypto/async/async.c index 2a51ee7bc2b..53b25d7b4b4 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