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:
@@ -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))
|
if (!CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID, NULL, &dlen))
|
||||||
return NULL;
|
return NULL;
|
||||||
wfname = OPENSSL_malloc(dlen);
|
wfname = OPENSSL_malloc(dlen);
|
||||||
|
if (wfname == NULL)
|
||||||
|
return NULL;
|
||||||
if (CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID, wfname, &dlen))
|
if (CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID, wfname, &dlen))
|
||||||
{
|
{
|
||||||
char *fname = wide_to_asc(wfname);
|
char *fname = wide_to_asc(wfname);
|
||||||
|
|||||||
Reference in New Issue
Block a user