Commit cf1bbb3b authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

crypt32: Avoid NULL ptr dereferences before checks (Coverity).

parent eeefed3d
......@@ -341,7 +341,7 @@ PCCTL_CONTEXT WINAPI CertFindCTLInStore(HCERTSTORE hCertStore,
BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
{
WINECRYPT_CERTSTORE *hcs = pCtlContext->hCertStore;
WINECRYPT_CERTSTORE *hcs;
ctl_t *ctl = ctl_from_ptr(pCtlContext);
BOOL ret;
......@@ -350,6 +350,8 @@ BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
if (!pCtlContext)
return TRUE;
hcs = pCtlContext->hCertStore;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
return FALSE;
......
......@@ -949,13 +949,15 @@ PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_
BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
{
WINECRYPT_CERTSTORE *hcs = pCertContext->hCertStore;
WINECRYPT_CERTSTORE *hcs;
TRACE("(%p)\n", pCertContext);
if (!pCertContext)
return TRUE;
hcs = pCertContext->hCertStore;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
return FALSE;
......@@ -1084,7 +1086,7 @@ BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
{
WINECRYPT_CERTSTORE *hcs = pCrlContext->hCertStore;
WINECRYPT_CERTSTORE *hcs;
BOOL ret;
TRACE("(%p)\n", pCrlContext);
......@@ -1092,6 +1094,8 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
if (!pCrlContext)
return TRUE;
hcs = pCrlContext->hCertStore;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment