]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
async: coverity 1446224 - dereference after null check
authorPauli <ppzgs1@gmail.com>
Wed, 17 Mar 2021 02:59:24 +0000 (12:59 +1000)
committerPauli <ppzgs1@gmail.com>
Sat, 20 Mar 2021 00:18:32 +0000 (10:18 +1000)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14589)

crypto/async/async.c

index 2a51ee7bc2b26805a5fcc540b6a4081214673f9f..53b25d7b4b492c6693674a658106cb87f68a468e 100644 (file)
@@ -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