Skip to content

Commit

Permalink
NTFS: IndexData: RemoveEntry: Bugfix: IndexOutOfRangeException was th…
Browse files Browse the repository at this point in the history
…rown in some cases
  • Loading branch information
TalAloni committed Dec 11, 2018
1 parent 45e4377 commit c9f6830
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,14 @@ public void RemoveEntry(byte[] key)
if (leaf.IndexEntries.Count == 0)
{
int indexOfLeafPointer = pathToLeaf[pathToLeaf.Count - 1].Key;
RemovePointer(pathToLeaf.GetRange(0, pathToLeaf.Count - 1), indexOfLeafPointer);
if (pathToLeaf.Count > 1)
{
RemovePointer(pathToLeaf.GetRange(0, pathToLeaf.Count - 1), indexOfLeafPointer);
}
else
{
RemovePointerFromRoot(indexOfLeafPointer);
}
DeallocateIndexRecord(leafRecordIndex);
}
}
Expand Down

0 comments on commit c9f6830

Please sign in to comment.