[NTOS:FSRTL]

- Use the correct parent node when replacing an identical cache entry in FsRtlAddToTunnelCache
CORE-11819

svn path=/trunk/; revision=72193
This commit is contained in:
Thomas Faber 2016-08-10 21:09:50 +00:00
parent 72eefb7a68
commit aed9207c96

View file

@ -467,21 +467,21 @@ FsRtlAddToTunnelCache(IN PTUNNEL Cache,
else
{
/* update parent node */
if (LastEntry->LeftChild == CurEntry)
if (RtlIsLeftChild(CurEntry))
{
RtlInsertAsLeftChild(LastEntry, NodeEntry);
RtlInsertAsLeftChild(RtlParent(CurEntry), NodeEntry);
}
else
{
RtlInsertAsRightChild(LastEntry, NodeEntry);
RtlInsertAsRightChild(RtlParent(CurEntry), NodeEntry);
}
}
/* remove entry */
RemoveEntryList(&((PTUNNEL_NODE_ENTRY)LastEntry)->TimerQueueEntry);
RemoveEntryList(&((PTUNNEL_NODE_ENTRY)CurEntry)->TimerQueueEntry);
/* free node entry */
FsRtlFreeTunnelNode((PTUNNEL_NODE_ENTRY)LastEntry, &PoolList);
FsRtlFreeTunnelNode((PTUNNEL_NODE_ENTRY)CurEntry, &PoolList);
/* decrement node count */
Cache->NumEntries--;