diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-17 12:59:24 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-20 10:18:32 +1000 |
commit | b6f0f546ff06fa9aa7e37c1a272e3a712c81fdc0 (patch) | |
tree | 2e61abda9d14cb6652492d8d5ac9634e0fc2b16d | |
parent | 28c21fa048db0f1850e533c82a13d01c98de7ea1 (diff) |
async: coverity 1446224 - dereference after null check
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14589)
-rw-r--r-- | crypto/async/async.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 |