diff --git a/src/windows-emulator/syscalls/memory.cpp b/src/windows-emulator/syscalls/memory.cpp index 42ca451b..25895695 100644 --- a/src/windows-emulator/syscalls/memory.cpp +++ b/src/windows-emulator/syscalls/memory.cpp @@ -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();