[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Rich Salz rsalz at openssl.org
Mon Nov 27 19:59:20 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  5d227f9af07646702e1247836f7fbf1ca9b8a2bc (commit)
      from  6ac9fda415c822cc5dd8c845893c6048c34492e0 (commit)


- Log -----------------------------------------------------------------
commit 5d227f9af07646702e1247836f7fbf1ca9b8a2bc
Author: Rich Salz <rsalz at openssl.org>
Date:   Mon Nov 27 14:11:36 2017 -0500

    Check for malloc failure
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4805)
    
    (cherry picked from commit 378db52bb0177ae03cac3c3ba194bb6dec34a2d7)

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

Summary of changes:
 crypto/cms/cms_sd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c
index 76c1f53..4108fe7 100644
--- a/crypto/cms/cms_sd.c
+++ b/crypto/cms/cms_sd.c
@@ -713,8 +713,10 @@ int CMS_SignerInfo_verify(CMS_SignerInfo *si)
     md = EVP_get_digestbyobj(si->digestAlgorithm->algorithm);
     if (md == NULL)
         return -1;
-    if (si->mctx == NULL)
-        si->mctx = EVP_MD_CTX_new();
+    if (si->mctx == NULL && (si->mctx = EVP_MD_CTX_new()) == NULL) {
+        CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY, ERR_R_MALLOC_FAILURE);
+        return -1;
+    }
     mctx = si->mctx;
     if (EVP_DigestVerifyInit(mctx, &si->pctx, md, NULL, si->pkey) <= 0)
         goto err;


More information about the openssl-commits mailing list