diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_gen.c')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_gen.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_gen.c b/src/lib/libcrypto/asn1/asn1_gen.c index 384088308f..08a5dec4a6 100644 --- a/src/lib/libcrypto/asn1/asn1_gen.c +++ b/src/lib/libcrypto/asn1/asn1_gen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1_gen.c,v 1.13 2015/02/12 06:04:24 jsg Exp $ */ | 1 | /* $OpenBSD: asn1_gen.c,v 1.14 2015/07/18 14:40:59 miod Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2002. | 3 | * project 2002. |
4 | */ | 4 | */ |
@@ -740,9 +740,14 @@ asn1_str2type(const char *str, int format, int utype) | |||
740 | atmp->value.asn1_string->length = rdlen; | 740 | atmp->value.asn1_string->length = rdlen; |
741 | atmp->value.asn1_string->type = utype; | 741 | atmp->value.asn1_string->type = utype; |
742 | 742 | ||
743 | } else if (format == ASN1_GEN_FORMAT_ASCII) | 743 | } else if (format == ASN1_GEN_FORMAT_ASCII) { |
744 | ASN1_STRING_set(atmp->value.asn1_string, str, -1); | 744 | if (ASN1_STRING_set(atmp->value.asn1_string, str, |
745 | else if ((format == ASN1_GEN_FORMAT_BITLIST) && | 745 | -1) == 0) { |
746 | ASN1err(ASN1_F_ASN1_STR2TYPE, | ||
747 | ERR_R_MALLOC_FAILURE); | ||
748 | goto bad_str; | ||
749 | } | ||
750 | } else if ((format == ASN1_GEN_FORMAT_BITLIST) && | ||
746 | (utype == V_ASN1_BIT_STRING)) { | 751 | (utype == V_ASN1_BIT_STRING)) { |
747 | if (!CONF_parse_list(str, ',', 1, bitstr_cb, | 752 | if (!CONF_parse_list(str, ',', 1, bitstr_cb, |
748 | atmp->value.bit_string)) { | 753 | atmp->value.bit_string)) { |