Skip to content

Commit

Permalink
fix(security): Fixed data leak in memory manager by resetting memory …
Browse files Browse the repository at this point in the history
…before being reused
  • Loading branch information
TwoTenPvP committed Sep 10, 2019
1 parent 1e48aa3 commit 9733543
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Ruffles/Memory/MemoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ internal HeapMemory AllocHeapMemory(uint size)
}

memory = new HeapMemory(allocSize);
}
else
{
// If we got one from the pool, we need to clear it
Array.Clear(memory.Buffer, 0, size);
}

memory.EnsureSize(allocSize);
Expand Down

0 comments on commit 9733543

Please sign in to comment.