fix: handle VirtualAlloc invalid size and flags

This commit is contained in:
CarlTSpeak
2025-08-08 14:52:03 +01:00
parent 0aea1f5385
commit 051cef2212

View File

@@ -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();