diff options
Diffstat (limited to 'crypto/async/async.c')
-rw-r--r-- | crypto/async/async.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/async/async.c b/crypto/async/async.c index 963d969d98..2a51ee7bc2 100644 --- a/crypto/async/async.c +++ b/crypto/async/async.c @@ -209,9 +209,15 @@ int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *wctx, int *ret, * fibre ran */ libctx = OSSL_LIB_CTX_set0_default(ctx->currjob->libctx); + if (libctx == NULL) { + /* Failed to set the default context */ + ERR_raise(ERR_LIB_ASYNC, ERR_R_INTERNAL_ERROR); + goto err; + } /* Resume previous job */ if (!async_fibre_swapcontext(&ctx->dispatcher, &ctx->currjob->fibrectx, 1)) { + ctx->currjob->libctx = OSSL_LIB_CTX_set0_default(libctx); ERR_raise(ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT); goto err; } |