forked from Mirrors/wine-wine
crypt32: Avoid reading freed memory when encountering a cyclic chain.
parent
65e8bf6f48
commit
4817fbc362
|
@ -306,7 +306,13 @@ static BOOL CRYPT_AddCertToSimpleChain(PCertificateChainEngine engine,
|
||||||
= subjectInfoStatus;
|
= subjectInfoStatus;
|
||||||
/* FIXME: initialize the rest of element */
|
/* FIXME: initialize the rest of element */
|
||||||
if (!(chain->cElement % engine->CycleDetectionModulus))
|
if (!(chain->cElement % engine->CycleDetectionModulus))
|
||||||
|
{
|
||||||
CRYPT_CheckSimpleChainForCycles(chain);
|
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,
|
CRYPT_CombineTrustStatus(&chain->TrustStatus,
|
||||||
&element->TrustStatus);
|
&element->TrustStatus);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
Loading…
Reference in New Issue