[PATCH] server: Fix page size calculation in write access check.

Torge Matthies openglfreak at googlemail.com
Wed Feb 24 13:53:33 CST 2021


Also fix a wrong comment. Ptrace and all of this code use longs.

Signed-off-by: Torge Matthies <openglfreak at googlemail.com>
---
 server/ptrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/ptrace.c b/server/ptrace.c
index 49347791d8c..88c176d2d0c 100644
--- a/server/ptrace.c
+++ b/server/ptrace.c
@@ -410,10 +410,10 @@ int read_process_memory( struct process *process, client_ptr_t ptr, data_size_t
 }
 
 /* make sure we can write to the whole address range */
-/* len is the total size (in ints) */
+/* len is the total size (in longs) */
 static int check_process_write_access( struct thread *thread, long *addr, data_size_t len )
 {
-    int page = get_page_size() / sizeof(int);
+    int page = get_page_size() / sizeof(long);
 
     for (;;)
     {
-- 
2.30.1




More information about the wine-devel mailing list