[PATCH 0/1] MR8199: crypt32: Duplicate provided root store in CRYPT_CreateChainEngine().
From: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/crypt32/chain.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index b99b5729332..1b38e789f15 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -117,17 +117,20 @@ HCERTCHAINENGINE CRYPT_CreateChainEngine(HCERTSTORE root, DWORD system_store, co CertificateChainEngine *engine; HCERTSTORE worldStores[4]; - if(!root) { + if (root) { + root = CertDuplicateStore(root); + } else { if(config->cbSize >= sizeof(CERT_CHAIN_ENGINE_CONFIG) && config->hExclusiveRoot) root = CertDuplicateStore(config->hExclusiveRoot); else if (config->hRestrictedRoot) root = CertDuplicateStore(config->hRestrictedRoot); else root = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, system_store, L"Root"); - if(!root) - return NULL; } + if(!root) + return NULL; + engine = CryptMemAlloc(sizeof(CertificateChainEngine)); if(!engine) { CertCloseStore(root, 0); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8199
participants (2)
-
Paul Gofman -
Paul Gofman (@gofman)