[PATCH] ntdll: Fix memory region check in NtQueryVirtualMemory
Patch by buggy(a)ifel.se. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45218 Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> --- Off-by-one error. We want to quit early if start is outside the range. start is outside the range if it is equal to base+size. dlls/ntdll/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 76dc6c284d..fb6ede656e 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -2756,7 +2756,7 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg ) MEMORY_BASIC_INFORMATION *info = arg; void *end = (char *)start + size; - if ((char *)info->BaseAddress + info->RegionSize < (char *)start) return 0; + if ((char *)info->BaseAddress + info->RegionSize <= (char *)start) return 0; if (info->BaseAddress >= end) { -- 2.21.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50040 Your paranoid android. === debian9 (build log) === error: patch failed: dlls/ntdll/virtual.c:2756 Task: Patch failed to apply === debian9 (build log) === error: patch failed: dlls/ntdll/virtual.c:2756 Task: Patch failed to apply
participants (2)
-
Andrew Eikum -
Marvin