mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Avoid crash if import directory is messed up
svn path=/trunk/; revision=13325
This commit is contained in:
parent
d3fb293ea3
commit
9627e4ac70
1 changed files with 6 additions and 0 deletions
|
@ -1577,6 +1577,12 @@ LdrPEFixupImports(PMODULE_OBJECT Module)
|
||||||
DPRINT("Processeing import directory at %p\n", ImportModuleDirectory);
|
DPRINT("Processeing import directory at %p\n", ImportModuleDirectory);
|
||||||
while (ImportModuleDirectory->Name)
|
while (ImportModuleDirectory->Name)
|
||||||
{
|
{
|
||||||
|
if (Module->Length <= ImportModuleDirectory->Name)
|
||||||
|
{
|
||||||
|
DPRINT1("Invalid import directory in %wZ\n", &Module->FullName);
|
||||||
|
return STATUS_SECTION_NOT_IMAGE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check to make sure that import lib is kernel */
|
/* Check to make sure that import lib is kernel */
|
||||||
ImportedName = (PCHAR) Module->Base + ImportModuleDirectory->Name;
|
ImportedName = (PCHAR) Module->Base + ImportModuleDirectory->Name;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue