Module: wine Branch: master Commit: 3047385437c7ef36996d0418ac378677f3e9d67c URL: https://source.winehq.org/git/wine.git/?a=commit;h=3047385437c7ef36996d0418a...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Apr 2 19:18:39 2020 +0200
dbghelp: Don't bother trying to initialize loader backend if we can't get debug base address from PEB.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dbghelp/dbghelp.c | 1 + dlls/dbghelp/macho_module.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index b54ebf1c54..369e098381 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -292,6 +292,7 @@ static BOOL check_live_target(struct process* pcs) base = base32; } else ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], &base, sizeof(base), NULL); + if (!base) return FALSE;
TRACE("got debug info address %#lx from PEB %p\n", base, pbi.PebBaseAddress); return elf_read_wine_loader_dbg_info(pcs, base) || macho_read_wine_loader_dbg_info(pcs, base); diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index 8aa232e1ed..413a25c663 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -1845,8 +1845,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in len = sizeof(image_infos.infos64); else len = sizeof(image_infos.infos32); - if (pcs->dbg_hdr_addr && - ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &image_infos, len, NULL)) + if (ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &image_infos, len, NULL)) { if (pcs->is_64bit) len = sizeof(image_info.info64);