[openssl] OpenSSL_1_1_1-stable update

bernd.edlinger at hotmail.de bernd.edlinger at hotmail.de
Sat Apr 6 08:20:18 UTC 2019


The branch OpenSSL_1_1_1-stable has been updated
       via  8851d3728725885d06db2ff4ef5e5ea3a080deef (commit)
      from  b7534359306754b90a4f18aa5231477510488713 (commit)


- Log -----------------------------------------------------------------
commit 8851d3728725885d06db2ff4ef5e5ea3a080deef
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Sun Mar 31 12:00:16 2019 +0200

    Fix the allocation size in EVP_OpenInit and PEM_SignFinal
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/8620)
    
    (cherry picked from commit 8cf85d489978c384a3f193fb7cb25469e0559f27)

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

Summary of changes:
 crypto/evp/p_open.c   | 2 +-
 crypto/pem/pem_sign.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c
index f2976f8..7dcb95b 100644
--- a/crypto/evp/p_open.c
+++ b/crypto/evp/p_open.c
@@ -40,7 +40,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
     }
 
     size = EVP_PKEY_size(priv);
-    key = OPENSSL_malloc(size + 2);
+    key = OPENSSL_malloc(size);
     if (key == NULL) {
         /* ERROR */
         EVPerr(EVP_F_EVP_OPENINIT, ERR_R_MALLOC_FAILURE);
diff --git a/crypto/pem/pem_sign.c b/crypto/pem/pem_sign.c
index 9662eb1..06fce45 100644
--- a/crypto/pem/pem_sign.c
+++ b/crypto/pem/pem_sign.c
@@ -31,7 +31,7 @@ int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
     int i, ret = 0;
     unsigned int m_len;
 
-    m = OPENSSL_malloc(EVP_PKEY_size(pkey) + 2);
+    m = OPENSSL_malloc(EVP_PKEY_size(pkey));
     if (m == NULL) {
         PEMerr(PEM_F_PEM_SIGNFINAL, ERR_R_MALLOC_FAILURE);
         goto err;


More information about the openssl-commits mailing list