[openssl] master update

shane.lontis at oracle.com shane.lontis at oracle.com
Wed Oct 2 23:32:45 UTC 2019


The branch master has been updated
       via  12fca1afd227a0a750dab7fa51876c42d47ce670 (commit)
      from  648b53b88ea55b4c2f2c8c57d041075731db5f95 (commit)


- Log -----------------------------------------------------------------
commit 12fca1afd227a0a750dab7fa51876c42d47ce670
Author: Shane Lontis <shane.lontis at oracle.com>
Date:   Thu Oct 3 09:29:51 2019 +1000

    Fix Coverity issues
    
    CID 1453954 & 1453955
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9977)

-----------------------------------------------------------------------

Summary of changes:
 providers/default/ciphers/cipher_aes_ocb.c | 12 ++++++++----
 providers/fips/selftest.c                  |  7 ++++---
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/providers/default/ciphers/cipher_aes_ocb.c b/providers/default/ciphers/cipher_aes_ocb.c
index 8875d79a87..93df4a5dbc 100644
--- a/providers/default/ciphers/cipher_aes_ocb.c
+++ b/providers/default/ciphers/cipher_aes_ocb.c
@@ -285,9 +285,11 @@ static void aes_ocb_freectx(void *vctx)
 {
     PROV_AES_OCB_CTX *ctx = (PROV_AES_OCB_CTX *)vctx;
 
-    aes_generic_ocb_cleanup(ctx);
-    OPENSSL_cleanse(ctx->base.iv, sizeof(ctx->base.iv));
-    OPENSSL_clear_free(ctx,  sizeof(*ctx));
+    if (ctx != NULL) {
+        aes_generic_ocb_cleanup(ctx);
+        OPENSSL_cleanse(ctx->base.iv, sizeof(ctx->base.iv));
+        OPENSSL_clear_free(ctx,  sizeof(*ctx));
+    }
 }
 
 static void *aes_ocb_dupctx(void *vctx)
@@ -300,8 +302,10 @@ static void *aes_ocb_dupctx(void *vctx)
         return NULL;
     }
     *ret = *in;
-    if (!aes_generic_ocb_copy_ctx(ret, in))
+    if (!aes_generic_ocb_copy_ctx(ret, in)) {
         OPENSSL_free(ret);
+        ret = NULL;
+    }
     return ret;
 }
 
diff --git a/providers/fips/selftest.c b/providers/fips/selftest.c
index a817b070e0..d954073d64 100644
--- a/providers/fips/selftest.c
+++ b/providers/fips/selftest.c
@@ -141,9 +141,10 @@ end:
     OPENSSL_free(module_checksum);
     OPENSSL_free(indicator_checksum);
 
-    (*st->bio_free_cb)(bio_indicator);
-    (*st->bio_free_cb)(bio_module);
-
+    if (st != NULL) {
+        (*st->bio_free_cb)(bio_indicator);
+        (*st->bio_free_cb)(bio_module);
+    }
     FIPS_state = ok ? FIPS_STATE_RUNNING : FIPS_STATE_ERROR;
 
     return ok;


More information about the openssl-commits mailing list