Sebastian Lackner : ntdll: Avoid crash when trying to access page prot of address beyond address space limit.

Alexandre Julliard julliard at winehq.org
Thu Nov 16 15:21:09 CST 2017


Module: wine
Branch: master
Commit: 959d240cbe5f13612ee7fb6fc0aaaef87c436118
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=959d240cbe5f13612ee7fb6fc0aaaef87c436118

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Thu Nov 16 14:14:01 2017 +0100

ntdll: Avoid crash when trying to access page prot of address beyond address space limit.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/virtual.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index d28b138..21ccdaa 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




More information about the wine-cvs mailing list