summaryrefslogtreecommitdiff
path: root/crypto/async
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-11-11 06:49:49 +1000
committerPauli <pauli@openssl.org>2021-11-12 19:53:02 +1000
commited5b26ce0b34ec00bdd53d15854a22bccbb4d415 (patch)
treebc5aef4074b3c2ed8dc2ca8cb4d428eaaaf2f41c /crypto/async
parent87fd67d997b236d1202546345d18384a968c9206 (diff)
downloadopenssl-new-ed5b26ce0b34ec00bdd53d15854a22bccbb4d415.tar.gz
Add return value NULL checks that were missing
Issues located by Brian Carpenter of Geeknik's Farm. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17007)
Diffstat (limited to 'crypto/async')
-rw-r--r--crypto/async/async.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/async/async.c b/crypto/async/async.c
index 84c5876852..a320d455b7 100644
--- a/crypto/async/async.c
+++ b/crypto/async/async.c
@@ -138,6 +138,10 @@ static void async_release_job(ASYNC_JOB *job) {
async_pool *pool;
pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);
+ if (pool == NULL) {
+ ERR_raise(ERR_LIB_ASYNC, ERR_R_INTERNAL_ERROR);
+ return;
+ }
OPENSSL_free(job->funcargs);
job->funcargs = NULL;
sk_ASYNC_JOB_push(pool->jobs, job);
@@ -148,6 +152,10 @@ void async_start_func(void)
ASYNC_JOB *job;
async_ctx *ctx = async_get_ctx();
+ if (ctx == NULL) {
+ ERR_raise(ERR_LIB_ASYNC, ERR_R_INTERNAL_ERROR);
+ return;
+ }
while (1) {
/* Run the job */
job = ctx->currjob;