From: Dr. Stephen Henson <steve@openssl.org>
Date: Sat, 17 Oct 2015 23:54:13 +0000 (+0100)
Subject: set string type when embedding
X-Git-Tag: OpenSSL_1_1_0-pre1~411
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f3e6f8c243710b8dc89f385196987ad83c7848d;p=openssl

set string type when embedding

Reviewed-by: Tim Hudson <tjh@openssl.org>
---

diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c
index 33a8e97442..6a2ad62d70 100644
--- a/crypto/asn1/tasn_new.c
+++ b/crypto/asn1/tasn_new.c
@@ -352,6 +352,7 @@ static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
         if (embed) {
             str = *(ASN1_STRING **)pval;
             memset(str, 0, sizeof(*str));
+            str->type = utype;
             str->flags = ASN1_STRING_FLAG_EMBED;
         } else {
             str = ASN1_STRING_type_new(utype);