From 17f39f0290e46a1442aae35ceeb30f49ba0a5882 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 7 Aug 2005 07:14:52 +0000 Subject: [PATCH] One more test can't hurt. svn path=/trunk/; revision=17140 --- reactos/ntoskrnl/mm/anonmem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index 6d21202527e..93bae50e26b 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -562,6 +562,13 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, return STATUS_INVALID_PAGE_PROTECTION; } + /* Check for valid Zero bits */ + if (ZeroBits > 21) + { + DPRINT1("Too many zero bits\n"); + return STATUS_INVALID_PARAMETER_3; + } + /* Check for valid Allocation Types */ if ((AllocationType &~ (MEM_COMMIT | MEM_RESERVE | MEM_RESET | MEM_PHYSICAL | MEM_TOP_DOWN | MEM_WRITE_WATCH)))