diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-05-14 23:03:22 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-06-04 21:30:41 -0400 |
commit | 13f74c66ce83cc554ed29f88706a3176a1788f45 (patch) | |
tree | 0cd9ea30a3270339160e27855a65c6773cf9a386 /crypto | |
parent | 2b91da968cec55de9d6db464c8c938d2930832e9 (diff) |
Constify s2i_ASN1_IA5STRING
Return directly NULL after ASN1_STRING_set, as it already has set an error code.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1074)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/x509v3/v3_ia5.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/x509v3/v3_ia5.c b/crypto/x509v3/v3_ia5.c index e509fbaf08..5e230df7d0 100644 --- a/crypto/x509v3/v3_ia5.c +++ b/crypto/x509v3/v3_ia5.c @@ -41,7 +41,7 @@ char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5) } ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, char *str) + X509V3_CTX *ctx, const char *str) { ASN1_IA5STRING *ia5; if (!str) { @@ -51,10 +51,9 @@ ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, } if ((ia5 = ASN1_IA5STRING_new()) == NULL) goto err; - if (!ASN1_STRING_set((ASN1_STRING *)ia5, (unsigned char *)str, - strlen(str))) { + if (!ASN1_STRING_set((ASN1_STRING *)ia5, str, strlen(str))) { ASN1_IA5STRING_free(ia5); - goto err; + return NULL; } #ifdef CHARSET_EBCDIC ebcdic2ascii(ia5->data, ia5->data, ia5->length); |