Huw Davies : ntdll: Use the correct size when the read spans a page boundary.

Alexandre Julliard julliard at winehq.org
Tue May 26 17:17:07 CDT 2020


Module: wine
Branch: master
Commit: a98dd5a63eb1f2c86f140c2639a70f865ee99c32
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a98dd5a63eb1f2c86f140c2639a70f865ee99c32

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue May 26 10:57:23 2020 +0100

ntdll: Use the correct size when the read spans a page boundary.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 f678b2387a..005c3ee441 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -2628,7 +2628,7 @@ SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T
 
             while (bytes_read < size && (VIRTUAL_GetUnixProt( get_page_vprot( page )) & PROT_READ))
             {
-                SIZE_T block_size = min( size, page_size - ((UINT_PTR)addr & page_mask) );
+                SIZE_T block_size = min( size - bytes_read, page_size - ((UINT_PTR)addr & page_mask) );
                 memcpy( buffer, addr, block_size );
 
                 addr   = (const void *)((const char *)addr + block_size);




More information about the wine-cvs mailing list