dbghelp: Check wImageName for NULL (Coverity).

This commit is contained in:
Marcus Meissner 2009-12-01 10:48:56 +01:00 committed by Alexandre Julliard
parent 28c6c44df4
commit d6f78e4014
1 changed files with 3 additions and 1 deletions

View File

@ -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
*/ */
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;