From 6fd9a98f1dfbdffbd1c9ea61eb24c40f95c54d69 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 31 Jan 2018 18:40:44 +0300 Subject: [PATCH] dbghelp: Use correct module name buffer length when doing enumeration. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dbghelp/dbghelp_private.h | 1 + dlls/dbghelp/module.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 684111c86c4..f37991dacd6 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -353,6 +353,7 @@ struct module { struct process* process; IMAGEHLP_MODULEW64 module; + WCHAR modulename[64]; /* used for enumeration */ struct module* next; enum module_type type : 16; unsigned short is_virtual : 1; diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 6c7f2dcb6de..9f90d5e0ca6 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -102,6 +102,7 @@ void module_set_module(struct module* module, const WCHAR* name) { module_fill_module(name, module->module.ModuleName, sizeof(module->module.ModuleName) / sizeof(module->module.ModuleName[0])); + module_fill_module(name, module->modulename, sizeof(module->modulename) / sizeof(module->modulename[0])); } const WCHAR *get_wine_loader_name(void) @@ -812,7 +813,7 @@ BOOL WINAPI SymEnumerateModulesW64(HANDLE hProcess, if (!(dbghelp_options & SYMOPT_WINE_WITH_NATIVE_MODULES) && (module->type == DMT_ELF || module->type == DMT_MACHO)) continue; - if (!EnumModulesCallback(module->module.ModuleName, + if (!EnumModulesCallback(module->modulename, module->module.BaseOfImage, UserContext)) break; }