mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
virtmem: fix incorrect bounds check
This commit is contained in:
parent
9e83f82a62
commit
145ad1ba87
@ -119,7 +119,7 @@ void* virtmemReserve(size_t size) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (size > meminfo.size) {
|
||||
if (addr + size > meminfo.addr + meminfo.size) {
|
||||
// We can't fit in this region, let's move past it.
|
||||
addr = meminfo.addr + meminfo.size;
|
||||
continue;
|
||||
@ -190,7 +190,7 @@ void* virtmemReserveStack(size_t size)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (size > meminfo.size) {
|
||||
if (addr + size > meminfo.addr + meminfo.size) {
|
||||
// We can't fit in this region, let's move past it.
|
||||
addr = meminfo.addr + meminfo.size;
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user