mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
capi_cert_get_fname: check for NULL after allocating wfname
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
e2140501fd
commit
8607322765
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user