Rémi Bernon : winedbg: Use target pointer size in indirect string access.

Alexandre Julliard julliard at winehq.org
Mon Apr 6 15:53:19 CDT 2020


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Sat Apr  4 11:30:13 2020 +0200

winedbg: Use target pointer size in indirect string access.

We read it into a void* so we also need to zero initialize it in case
the target pointer size is shorter than ours.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/winedbg/memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c
index 053ace94ac..c9b97686aa 100644
--- a/programs/winedbg/memory.c
+++ b/programs/winedbg/memory.c
@@ -268,12 +268,12 @@ BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee,
 
 BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, WCHAR* buffer, int size)
 {
-    void*       ad;
+    void*       ad = 0;
     SIZE_T	sz;
 
     buffer[0] = 0;
     if (addr &&
-        pcs->process_io->read(pcs->handle, addr, &ad, sizeof(ad), &sz) && sz == sizeof(ad) && ad)
+        pcs->process_io->read(pcs->handle, addr, &ad, pcs->be_cpu->pointer_size, &sz) && sz == pcs->be_cpu->pointer_size && ad)
     {
         LPSTR buff;
         BOOL ret;




More information about the wine-cvs mailing list