Commit 9686e7b2 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Don't crash if adding to a provider store fails.

parent 30de39b2
...@@ -78,7 +78,7 @@ static BOOL CRYPT_ProvAddCert(PWINECRYPT_CERTSTORE store, void *cert, ...@@ -78,7 +78,7 @@ static BOOL CRYPT_ProvAddCert(PWINECRYPT_CERTSTORE store, void *cert,
/* dirty trick: replace the returned context's hCertStore with /* dirty trick: replace the returned context's hCertStore with
* store. * store.
*/ */
if (ppStoreContext) if (ret && ppStoreContext)
(*(PCERT_CONTEXT *)ppStoreContext)->hCertStore = store; (*(PCERT_CONTEXT *)ppStoreContext)->hCertStore = store;
return ret; return ret;
} }
...@@ -145,7 +145,7 @@ static BOOL CRYPT_ProvAddCRL(PWINECRYPT_CERTSTORE store, void *crl, ...@@ -145,7 +145,7 @@ static BOOL CRYPT_ProvAddCRL(PWINECRYPT_CERTSTORE store, void *crl,
/* dirty trick: replace the returned context's hCertStore with /* dirty trick: replace the returned context's hCertStore with
* store. * store.
*/ */
if (ppStoreContext) if (ret && ppStoreContext)
(*(PCRL_CONTEXT *)ppStoreContext)->hCertStore = store; (*(PCRL_CONTEXT *)ppStoreContext)->hCertStore = store;
return ret; return ret;
} }
...@@ -212,7 +212,7 @@ static BOOL CRYPT_ProvAddCTL(PWINECRYPT_CERTSTORE store, void *ctl, ...@@ -212,7 +212,7 @@ static BOOL CRYPT_ProvAddCTL(PWINECRYPT_CERTSTORE store, void *ctl,
/* dirty trick: replace the returned context's hCertStore with /* dirty trick: replace the returned context's hCertStore with
* store. * store.
*/ */
if (ppStoreContext) if (ret && ppStoreContext)
(*(PCTL_CONTEXT *)ppStoreContext)->hCertStore = store; (*(PCTL_CONTEXT *)ppStoreContext)->hCertStore = store;
return ret; return ret;
} }
......
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