mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Fix potential overflow in sys_vm
This commit is contained in:
parent
517a2bc34a
commit
ade291e73d
2 changed files with 10 additions and 10 deletions
|
@ -717,7 +717,7 @@ namespace vm
|
|||
shm = std::make_shared<utils::shm>(size);
|
||||
|
||||
// Search for an appropriate place (unoptimized)
|
||||
for (u32 addr = ::align(this->addr, align); addr < this->addr + this->size - 1; addr += align)
|
||||
for (u32 addr = ::align(this->addr, align); u64{addr} + size < u64{this->addr} + this->size - 1; addr += align)
|
||||
{
|
||||
if (try_alloc(addr, pflags, size, std::move(shm)))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue