Alistair Leslie-Hughes : dbghelp: Fix use after free.

Alexandre Julliard julliard at winehq.org
Mon Dec 13 15:59:53 CST 2021


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

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Thu Dec  9 07:33:58 2021 +1100

dbghelp: Fix use after free.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dbghelp/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c
index 5614c575cd0..def7b799d73 100644
--- a/dlls/dbghelp/module.c
+++ b/dlls/dbghelp/module.c
@@ -1058,7 +1058,6 @@ BOOL WINAPI SymUnloadModule64(HANDLE hProcess, DWORD64 BaseOfDll)
     if (!pcs) return FALSE;
     module = module_find_by_addr(pcs, BaseOfDll, DMT_UNKNOWN);
     if (!module) return FALSE;
-    if (!module_remove(pcs, module)) return FALSE;
     /* remove local scope if defined inside this module */
     if (pcs->localscope_pc >= module->module.BaseOfImage &&
         pcs->localscope_pc < module->module.BaseOfImage + module->module.ImageSize)
@@ -1066,6 +1065,7 @@ BOOL WINAPI SymUnloadModule64(HANDLE hProcess, DWORD64 BaseOfDll)
         pcs->localscope_pc = 0;
         pcs->localscope_symt = NULL;
     }
+    module_remove(pcs, module);
     return TRUE;
 }
 




More information about the wine-cvs mailing list