crypt32: Avoid a use-after-free bug in tests.
This commit is contained in:
parent
2eec6b04c0
commit
769a52f831
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue