[openssl-commits] [openssl] master update

Kurt Roeckx kurt at openssl.org
Sun Feb 22 12:22:28 UTC 2015


The branch master has been updated
       via  bcfa19a8d19506c26b5f8d9d9934ca2aa5f96b43 (commit)
       via  edac5dc220d494dff7ee259dfd84335ffa50e938 (commit)
       via  1549a265209d449b6aefd2b49d7d39f7fbe0689b (commit)
      from  ba4bdee7184a5cea5bef8739eb360e5c2bc3b52c (commit)


- Log -----------------------------------------------------------------
commit bcfa19a8d19506c26b5f8d9d9934ca2aa5f96b43
Author: Edgar Pek <edgar.pek at gmail.com>
Date:   Sat Feb 21 14:56:41 2015 +0100

    Fix null-pointer dereference
    
    Signed-off-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit edac5dc220d494dff7ee259dfd84335ffa50e938
Author: Kurt Roeckx <kurt at roeckx.be>
Date:   Sat Feb 21 14:51:50 2015 +0100

    Fix memory leak
    
    Reviewed-by: Matt Caswell <matt at openssl.org>

commit 1549a265209d449b6aefd2b49d7d39f7fbe0689b
Author: Doug Hogan <doug at acyclic.org>
Date:   Wed Jan 7 18:21:01 2015 -0800

    Avoid a double-free in an error path.
    
    Signed-off-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Matt Caswell <matt at openssl.org>

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

Summary of changes:
 crypto/dh/dh_ameth.c |    2 ++
 engines/e_ubsec.c    |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c
index 2ead91f..14d291f 100644
--- a/crypto/dh/dh_ameth.c
+++ b/crypto/dh/dh_ameth.c
@@ -248,6 +248,7 @@ static int dh_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
     DHerr(DH_F_DH_PRIV_DECODE, EVP_R_DECODE_ERROR);
  dherr:
     DH_free(dh);
+    ASN1_INTEGER_free(privkey);
     return 0;
 }
 
@@ -283,6 +284,7 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
     dplen = i2d_ASN1_INTEGER(prkey, &dp);
 
     ASN1_INTEGER_free(prkey);
+    prkey = NULL;
 
     if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0,
                          V_ASN1_SEQUENCE, params, dp, dplen))
diff --git a/engines/e_ubsec.c b/engines/e_ubsec.c
index 2d6331d..6f09ffb 100644
--- a/engines/e_ubsec.c
+++ b/engines/e_ubsec.c
@@ -967,11 +967,11 @@ static int ubsec_dh_generate_key(DH *dh)
 
     if (dh->pub_key == NULL) {
         pub_key = BN_new();
+        if (pub_key == NULL)
+            goto err;
         pub_key_len = BN_num_bits(dh->p);
         if (bn_wexpand(pub_key, dh->p->top) == NULL)
             goto err;
-        if (pub_key == NULL)
-            goto err;
     } else {
         pub_key = dh->pub_key;
     }


More information about the openssl-commits mailing list