openssl_stream: fix NULL pointer dereference

This commit is contained in:
Patrick Steinhardt 2016-02-23 11:16:36 +01:00
parent 2baf854e97
commit 05bf67b901

View File

@ -383,6 +383,8 @@ static int verify_server_cert(SSL *ssl, const char *host)
GITERR_CHECK_ALLOC(peer_cn);
memcpy(peer_cn, ASN1_STRING_data(str), size);
peer_cn[size] = '\0';
} else {
goto cert_fail_name;
}
} else {
int size = ASN1_STRING_to_UTF8(&peer_cn, str);