Fix bounds check in PageAllocator.Free

This commit is contained in:
ghorsington committed 2021-01-05 22:55:40 +02:00
1 parent 5ce78b3c53
commit 6f25c6e862
1 file changed
+1 -1
@@ -92,7 +92,7 @@ namespace BepInEx.IL2CPP.Hook.Allocator
foreach (var allocatedChunk in allocatedChunks)
{
long index = (page - allocatedChunk.BaseAddress) / PAGE_SIZE;
if (index < 0 || index > PAGES_PER_UNIT)
if (index < 0 || index >= PAGES_PER_UNIT)
continue;
allocatedChunk.Pages[index] = false;
return;