Commit 86073227 authored by Jonas Maebe's avatar Jonas Maebe Committed by Kurt Roeckx
Browse files

capi_cert_get_fname: check for NULL after allocating wfname

parent e2140501
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1333,6 +1333,8 @@ char * capi_cert_get_fname(CAPI_CTX *ctx, PCCERT_CONTEXT cert)
	if (!CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID, NULL, &dlen))
		return NULL;
	wfname = OPENSSL_malloc(dlen);
	if (wfname == NULL)
		return NULL;
	if (CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID, wfname, &dlen))
		{
		char *fname = wide_to_asc(wfname);