Commit 769a52f8 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Avoid a use-after-free bug in tests.

parent 2eec6b04
......@@ -149,6 +149,10 @@ static void testAddCert(void)
CRYPT_DATA_BLOB hash = { sizeof(bigCert2Hash),
(LPBYTE)bigCert2Hash };
/* Duplicate (AddRef) the context so we can still use it after
* deleting it from the store.
*/
CertDuplicateCertificateContext(context);
CertDeleteCertificateFromStore(context);
/* Set the same hash as bigCert2, and try to readd it */
ret = CertSetCertificateContextProperty(context, CERT_HASH_PROP_ID,
......
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