Skip to content

Commit

Permalink
HeapArray: Avoid writing out of bounds in internal_resize
Browse files Browse the repository at this point in the history
  • Loading branch information
DaZombieKiller authored and refractionpcsx2 committed Apr 24, 2024
1 parent 550da21 commit d48c3cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/HeapArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ class DynamicHeapArray

if (prev_ptr)
{
std::memcpy(m_data, prev_ptr, prev_size * sizeof(T));
std::memcpy(m_data, prev_ptr, std::min(size, prev_size) * sizeof(T));
std::free(prev_ptr);
}
#endif
Expand Down

0 comments on commit d48c3cf

Please sign in to comment.