[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Richard Levitte levitte at openssl.org
Mon Oct 23 15:44:36 UTC 2017


The branch OpenSSL_1_0_2-stable has been updated
       via  cdc3307d4257f4fcebbab3b2b44207e1a399da05 (commit)
      from  8c6101781a47cb33a5ccba50b8abfe2b6ab42c03 (commit)


- Log -----------------------------------------------------------------
commit cdc3307d4257f4fcebbab3b2b44207e1a399da05
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Oct 23 16:48:17 2017 +0200

    asn1_item_embed_new(): don't free an embedded item
    
    An embedded item wasn't allocated separately on the heap, so don't
    free it as if it was.
    
    Issue discovered by Pavel Kopyl
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4571)

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

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

diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c
index 54f459d..1e21da2 100644
--- a/crypto/asn1/tasn_new.c
+++ b/crypto/asn1/tasn_new.c
@@ -199,7 +199,8 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
     return 1;
 
  memerr2:
-    ASN1_item_ex_free(pval, it);
+    if (!combine)
+        ASN1_item_ex_free(pval, it);
  memerr:
     ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ERR_R_MALLOC_FAILURE);
 #ifdef CRYPTO_MDEBUG
@@ -209,7 +210,8 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
     return 0;
 
  auxerr2:
-    ASN1_item_ex_free(pval, it);
+    if (!combine)
+        ASN1_item_ex_free(pval, it);
  auxerr:
     ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ASN1_R_AUX_ERROR);
 #ifdef CRYPTO_MDEBUG


More information about the openssl-commits mailing list