Module: wine Branch: master Commit: d47bdb3eb270b31d2c507a91a49ede20f4cdf2aa URL: https://gitlab.winehq.org/wine/wine/-/commit/d47bdb3eb270b31d2c507a91a49ede2...
Author: Tim Clem tclem@codeweavers.com Date: Tue Nov 8 13:44:00 2022 -0800
wow64: Truncate too-large regions from NtQueryVirtualMemory(MemoryBasicInformation).
BaseAddress + RegionSize should not exceed the highest WoW user address.
---
dlls/wow64/virtual.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index 4d3bb90386a..8396b2de334 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -399,6 +399,8 @@ NTSTATUS WINAPI wow64_NtQueryVirtualMemory( UINT *args ) info32->State = info.State; info32->Protect = info.Protect; info32->Type = info.Type; + if ((ULONG_PTR)info.BaseAddress + info.RegionSize > highest_user_address) + info32->RegionSize = highest_user_address - (ULONG_PTR)info.BaseAddress + 1; } } res_len = sizeof(MEMORY_BASIC_INFORMATION32);