[DBGHELP] Prevent crashing on a malformed PE file.

CORE-15030
This commit is contained in:
Mark Jansen 2018-09-12 21:30:49 +02:00
parent ee4ee2fc1d
commit 25d143dd20
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -615,6 +615,15 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs, struct module* mod
dbg = RtlImageRvaToVa(nth, mapping, dir->VirtualAddress, NULL);
#ifdef __REACTOS__
if (!dbg)
{
ERR("Debug directory not found in module %s\n",
debugstr_w(module->module.ModuleName));
goto done;
}
#endif
/* Parse debug directory */
if (nth->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED)
{