From ae0ebdc3ebc77c08be34c0c8da76db4da3773bf0 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Thu, 6 Mar 2008 09:39:36 +0000 Subject: [PATCH] - Our precious kernel should be handled with love and care, with thorough check of every change going in! Not with "commit-and-forget" fashion. - MmSecureVirtualMemory fails in case of Length = 0 too. svn path=/trunk/; revision=32579 --- reactos/ntoskrnl/mm/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/virtual.c b/reactos/ntoskrnl/mm/virtual.c index 3531d242c42..c77d1a701c3 100644 --- a/reactos/ntoskrnl/mm/virtual.c +++ b/reactos/ntoskrnl/mm/virtual.c @@ -963,7 +963,7 @@ MmSecureVirtualMemory(PVOID Address, ULONG Mode) { /* Only works for user space */ - if (((ULONG_PTR)Address > (ULONG_PTR)Address + Length) || + if (((ULONG_PTR)Address >= (ULONG_PTR)Address + Length) || ((ULONG_PTR)MmHighestUserAddress < (ULONG_PTR)Address + Length)) { return NULL;