Commit 4817fbc3 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Avoid reading freed memory when encountering a cyclic chain.

parent 65e8bf6f
......@@ -306,7 +306,13 @@ static BOOL CRYPT_AddCertToSimpleChain(PCertificateChainEngine engine,
= subjectInfoStatus;
/* FIXME: initialize the rest of element */
if (!(chain->cElement % engine->CycleDetectionModulus))
{
CRYPT_CheckSimpleChainForCycles(chain);
/* Reinitialize the element pointer in case the chain is
* cyclic, in which case the chain is truncated.
*/
element = chain->rgpElement[chain->cElement - 1];
}
CRYPT_CombineTrustStatus(&chain->TrustStatus,
&element->TrustStatus);
ret = TRUE;
......
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