[PATCH] dbghelp: check for wImageName being NULL (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Jan 31 06:23:35 CST 2009


Hi,

CID 521, we probably can enter this case with hFile set and wImageName
NULL. So check for it and fall into the error case below.

Ciao, Marcus
---
 dlls/dbghelp/module.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c
index 49b7742..fcdea2e 100644
--- a/dlls/dbghelp/module.c
+++ b/dlls/dbghelp/module.c
@@ -543,7 +543,7 @@ DWORD64 WINAPI  SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
         if (!(module = pe_load_native_module(pcs, wImageName, hFile, BaseOfDll, SizeOfDll)))
         {
             /* and finally and ELF module */
-            if (module_get_type_by_name(wImageName) == DMT_ELF)
+            if (wImageName && (module_get_type_by_name(wImageName) == DMT_ELF))
                 module = elf_load_module(pcs, wImageName, BaseOfDll);
         }
     }
-- 
1.5.6



More information about the wine-patches mailing list