https://github.com/curl/curl/issues/8559 https://bugs.gentoo.org/836629 From 911714d617c106ed5d553bf003e34ec94ab6a136 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 8 Mar 2022 13:38:13 +0100 Subject: [PATCH] openssl: fix CN check error code Due to a missing 'else' this returns error too easily. Regressed in: d15692ebb Reported-by: Kristoffer Gleditsch Fixes #8559 Closes #8560 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1817,7 +1817,8 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, memcpy(peer_CN, ASN1_STRING_get0_data(tmp), peerlen); peer_CN[peerlen] = '\0'; } - result = CURLE_OUT_OF_MEMORY; + else + result = CURLE_OUT_OF_MEMORY; } } else /* not a UTF8 name */