From: Gunter Knauf Date: Wed, 14 Oct 2009 02:32:27 +0000 (+0000) Subject: we only need to call ASN1_STRING_length() if ASN1_STRING_type() detects UTF-8, X-Git-Tag: curl-7_19_7~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6daede08cb3ad27095cf9d41ac9f8761970bcb3a;p=thirdparty%2Fcurl.git we only need to call ASN1_STRING_length() if ASN1_STRING_type() detects UTF-8, else ASN1_STRING_to_UTF8() returns the string length. --- diff --git a/lib/ssluse.c b/lib/ssluse.c index 2ea3b2f559..8cf834b14d 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -1176,8 +1176,8 @@ static CURLcode verifyhost(struct connectdata *conn, conditional in the future when OpenSSL has been fixed. Work-around brought by Alexis S. L. Carvalho. */ if(tmp) { - j = ASN1_STRING_length(tmp); if(ASN1_STRING_type(tmp) == V_ASN1_UTF8STRING) { + j = ASN1_STRING_length(tmp); if(j >= 0) { peer_CN = OPENSSL_malloc(j+1); if(peer_CN) {