[openssl-commits] [openssl] OpenSSL_1_1_0-stable update
Richard Levitte
levitte at openssl.org
Mon Oct 23 15:47:51 UTC 2017
The branch OpenSSL_1_1_0-stable has been updated
via ca80ba81e243c30873cd11870422a3873a64be73 (commit)
from 84a85b5755befabd450fbb7cc63d5e23a268ddb0 (commit)
- Log -----------------------------------------------------------------
commit ca80ba81e243c30873cd11870422a3873a64be73
Author: Richard Levitte <levitte at openssl.org>
Date: Mon Oct 23 16:41:06 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/4572)
(cherry picked from commit 590bbdfdf43b97abf8817f506f8ab46687d1eadd)
-----------------------------------------------------------------------
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 f695e38..7608b43 100644
--- a/crypto/asn1/tasn_new.c
+++ b/crypto/asn1/tasn_new.c
@@ -142,7 +142,8 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
return 1;
memerr2:
- ASN1_item_ex_free(pval, it);
+ if (!embed)
+ ASN1_item_ex_free(pval, it);
memerr:
ASN1err(ASN1_F_ASN1_ITEM_EMBED_NEW, ERR_R_MALLOC_FAILURE);
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
@@ -151,7 +152,8 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
return 0;
auxerr2:
- ASN1_item_ex_free(pval, it);
+ if (!embed)
+ ASN1_item_ex_free(pval, it);
auxerr:
ASN1err(ASN1_F_ASN1_ITEM_EMBED_NEW, ASN1_R_AUX_ERROR);
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
More information about the openssl-commits
mailing list