mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-20 20:23:57 +00:00
fix: handle VirtualAlloc invalid size and flags
This commit is contained in:
@@ -181,6 +181,12 @@ namespace syscalls
|
||||
}
|
||||
|
||||
auto allocation_bytes = bytes_to_allocate.read();
|
||||
|
||||
if (allocation_bytes == 0)
|
||||
{
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
allocation_bytes = page_align_up(allocation_bytes);
|
||||
bytes_to_allocate.write(allocation_bytes);
|
||||
|
||||
@@ -244,6 +250,11 @@ namespace syscalls
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (free_type == 0)
|
||||
{
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
const auto allocation_base = base_address.read();
|
||||
const auto allocation_size = bytes_to_allocate.read();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user