Nikolay Sivov : dbghelp: Use correct module name buffer length when doing enumeration.

Alexandre Julliard julliard at winehq.org
Wed Jan 31 15:23:28 CST 2018


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Jan 31 18:40:44 2018 +0300

dbghelp: Use correct module name buffer length when doing enumeration.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 684111c..f37991d 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 6c7f2dc..9f90d5e 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;
     }




More information about the wine-cvs mailing list