aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/x509v3/v3_utl.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/crypto/x509v3/v3_utl.c')
-rw-r--r--openssl/crypto/x509v3/v3_utl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openssl/crypto/x509v3/v3_utl.c b/openssl/crypto/x509v3/v3_utl.c
index f65323be0..ed6099e12 100644
--- a/openssl/crypto/x509v3/v3_utl.c
+++ b/openssl/crypto/x509v3/v3_utl.c
@@ -901,8 +901,13 @@ static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal,
int astrlen;
unsigned char *astr;
astrlen = ASN1_STRING_to_UTF8(&astr, a);
- if (astrlen < 0)
+ if (astrlen < 0) {
+ /*
+ * -1 could be an internal malloc failure or a decoding error from
+ * malformed input; we can't distinguish.
+ */
return -1;
+ }
rv = equal(astr, astrlen, (unsigned char *)b, blen, flags);
if (rv > 0 && peername)
*peername = BUF_strndup((char *)astr, astrlen);