diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-10-06 22:53:48 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-10-11 20:33:56 +0100 |
commit | 44c734e95c4242af5ccfd7e5c4653eb196705cb9 (patch) | |
tree | 7f4374541abe34185f81b59cfb0c2635d2ab80a2 /crypto/asn1/tasn_new.c | |
parent | 71a64af3312d4dfdff2597a979868d2bdd7e3642 (diff) |
embed support for CHOICE type
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/asn1/tasn_new.c')
-rw-r--r-- | crypto/asn1/tasn_new.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c index 294912c188..13db8676fc 100644 --- a/crypto/asn1/tasn_new.c +++ b/crypto/asn1/tasn_new.c @@ -142,9 +142,13 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed) return 1; } } - *pval = OPENSSL_zalloc(it->size); - if (!*pval) - goto memerr; + if (embed) { + memset(*pval, 0, it->size); + } else { + *pval = OPENSSL_zalloc(it->size); + if (!*pval) + goto memerr; + } asn1_set_choice_selector(pval, -1, it); if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) goto auxerr; |