Module: wine Branch: master Commit: 62fbfe87612eb973a42b73adc8f023bc2dc4cbb1 URL: https://gitlab.winehq.org/wine/wine/-/commit/62fbfe87612eb973a42b73adc8f023b...
Author: Tim Clem tclem@codeweavers.com Date: Tue Nov 8 13:50:02 2022 -0800
wow64: Return error from NtQueryVirtualMemory(MemoryRegionInformation) for a too-large address.
---
dlls/wow64/virtual.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index 8396b2de334..f9a0e0b6bc8 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -426,7 +426,11 @@ NTSTATUS WINAPI wow64_NtQueryVirtualMemory( UINT *args )
case MemoryRegionInformation: /* MEMORY_REGION_INFORMATION */ { - if (len >= sizeof(MEMORY_REGION_INFORMATION32)) + if (len < sizeof(MEMORY_REGION_INFORMATION32)) + status = STATUS_INFO_LENGTH_MISMATCH; + if ((ULONG_PTR)addr > highest_user_address) + status = STATUS_INVALID_PARAMETER; + else { MEMORY_REGION_INFORMATION info; MEMORY_REGION_INFORMATION32 *info32 = ptr; @@ -442,7 +446,6 @@ NTSTATUS WINAPI wow64_NtQueryVirtualMemory( UINT *args ) info32->NodePreference = info.NodePreference; } } - else status = STATUS_INFO_LENGTH_MISMATCH; res_len = sizeof(MEMORY_REGION_INFORMATION32); break; }