Commit 489c6b38 authored by Alexandre Julliard's avatar Alexandre Julliard

Ignore relocations for unmapped pages.

parent c818a4e6
...@@ -780,8 +780,7 @@ static int do_relocations( char *base, const IMAGE_DATA_DIRECTORY *dir, ...@@ -780,8 +780,7 @@ static int do_relocations( char *base, const IMAGE_DATA_DIRECTORY *dir,
if (!count) continue; if (!count) continue;
/* sanity checks */ /* sanity checks */
if ((char *)rel + rel->SizeOfBlock > base + dir->VirtualAddress + dir->Size || if ((char *)rel + rel->SizeOfBlock > base + dir->VirtualAddress + dir->Size)
page > base + total_size)
{ {
ERR_(module)("invalid relocation %p,%lx,%ld at %p,%lx,%lx\n", ERR_(module)("invalid relocation %p,%lx,%ld at %p,%lx,%lx\n",
rel, rel->VirtualAddress, rel->SizeOfBlock, rel, rel->VirtualAddress, rel->SizeOfBlock,
...@@ -789,7 +788,14 @@ static int do_relocations( char *base, const IMAGE_DATA_DIRECTORY *dir, ...@@ -789,7 +788,14 @@ static int do_relocations( char *base, const IMAGE_DATA_DIRECTORY *dir,
return 0; return 0;
} }
TRACE_(module)("%ld relocations for page %lx\n", rel->SizeOfBlock, rel->VirtualAddress); if (page > base + total_size)
{
WARN_(module)("skipping %d relocations for page %p beyond module %p-%p\n",
count, page, base, base + total_size );
continue;
}
TRACE_(module)("%d relocations for page %lx\n", count, rel->VirtualAddress);
/* patching in reverse order */ /* patching in reverse order */
for (i = 0 ; i < count; i++) for (i = 0 ; i < count; i++)
......
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