[Kernel/Memory] Return error when region_size is 0

This commit is contained in:
Gliniak 2021-04-10 13:19:08 +02:00 committed by Rick Gibbed
parent 4ce43369a7
commit 30ea6e3ea3
1 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ dword_result_t NtAllocateVirtualMemory(lpdword_t base_addr_ptr,
// it's simple today we could extend it to do better things in the future. // it's simple today we could extend it to do better things in the future.
// Must request a size. // Must request a size.
if (!base_addr_ptr || !region_size_ptr) { if (!base_addr_ptr || !region_size_ptr || !*region_size_ptr) {
return X_STATUS_INVALID_PARAMETER; return X_STATUS_INVALID_PARAMETER;
} }
// Check allocation type. // Check allocation type.
@ -198,7 +198,7 @@ dword_result_t NtProtectVirtualMemory(lpdword_t base_addr_ptr,
assert_true(debug_memory == 0); assert_true(debug_memory == 0);
// Must request a size. // Must request a size.
if (!base_addr_ptr || !region_size_ptr) { if (!base_addr_ptr || !region_size_ptr || !*region_size_ptr) {
return X_STATUS_INVALID_PARAMETER; return X_STATUS_INVALID_PARAMETER;
} }