[NTOSKRNL:FSRTL] Fix memory corruption when pruning tunnel cache

This commit is contained in:
Jérôme Gardou 2020-12-04 16:02:26 +01:00
parent 3ec3e1a7f6
commit 0db79d4aa9

View File

@ -124,7 +124,8 @@ FsRtlPruneTunnelCache(
/* If we have too many entries */
while (Cache->NumEntries > TunnelMaxEntries)
{
CurEntry = CONTAINING_RECORD(Entry, TUNNEL_NODE_ENTRY, TimerQueueEntry);
ASSERT(!IsListEmpty(&Cache->TimerQueue));
CurEntry = CONTAINING_RECORD(Cache->TimerQueue.Flink, TUNNEL_NODE_ENTRY, TimerQueueEntry);
FsRtlRemoveNodeFromTunnel(Cache, CurEntry, PoolList, &Rebalance);
}
}