From 40f1c6693ba06edad4984700ba4a52df5c8e0860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 4 Apr 2020 11:30:13 +0200 Subject: [PATCH] winedbg: Use target pointer size in indirect string access. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Alexandre Julliard --- 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 053ace94ac8..c9b97686aab 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;