From 959d240cbe5f13612ee7fb6fc0aaaef87c436118 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 16 Nov 2017 14:14:01 +0100 Subject: [PATCH] ntdll: Avoid crash when trying to access page prot of address beyond address space limit. Signed-off-by: Alexandre Julliard --- dlls/ntdll/virtual.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index d28b138e575..21ccdaadd47 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -185,6 +185,7 @@ static BYTE get_page_vprot( const void *addr ) size_t idx = (size_t)addr >> page_shift; #ifdef _WIN64 + if ((idx >> pages_vprot_shift) >= pages_vprot_size) return 0; if (!pages_vprot[idx >> pages_vprot_shift]) return 0; return pages_vprot[idx >> pages_vprot_shift][idx & pages_vprot_mask]; #else