Commit d6f78e40 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

dbghelp: Check wImageName for NULL (Coverity).

parent 28c6c44d
...@@ -534,6 +534,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam ...@@ -534,6 +534,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
if (Flags & SLMFLAG_VIRTUAL) if (Flags & SLMFLAG_VIRTUAL)
{ {
if (!wImageName) return FALSE;
module = module_new(pcs, wImageName, module_get_type_by_name(wImageName), module = module_new(pcs, wImageName, module_get_type_by_name(wImageName),
TRUE, (DWORD)BaseOfDll, SizeOfDll, 0, 0); TRUE, (DWORD)BaseOfDll, SizeOfDll, 0, 0);
if (!module) return FALSE; if (!module) return FALSE;
...@@ -594,7 +595,8 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam ...@@ -594,7 +595,8 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
*/ */
if (wModuleName) if (wModuleName)
module_set_module(module, wModuleName); module_set_module(module, wModuleName);
lstrcpynW(module->module.ImageName, wImageName, if (wImageName)
lstrcpynW(module->module.ImageName, wImageName,
sizeof(module->module.ImageName) / sizeof(WCHAR)); sizeof(module->module.ImageName) / sizeof(WCHAR));
return module->module.BaseOfImage; return module->module.BaseOfImage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment