From ffc9df2d0caf2aa0e18fbf790bacca4939f19386 Mon Sep 17 00:00:00 2001 From: Andrew Lewycky Date: Fri, 30 Nov 2001 23:08:02 +0000 Subject: [PATCH] do_relocations: process relocation blocks with a VirtualAddress of 0, stop once SizeOfBlock == 0. --- loader/pe_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/pe_image.c b/loader/pe_image.c index 6136a40831c..74628d12262 100644 --- a/loader/pe_image.c +++ b/loader/pe_image.c @@ -401,7 +401,7 @@ static int do_relocations( char *base, const IMAGE_NT_HEADERS *nt, const char *f if ((nt->OptionalHeader.ImageBase & 0x80000000) && !((DWORD)base & 0x80000000)) ERR( "Forced to relocate system DLL (base > 2GB). This is not good.\n" ); - for ( ; ((char *)rel < base + dir->VirtualAddress + dir->Size) && rel->VirtualAddress; + for ( ; ((char *)rel < base + dir->VirtualAddress + dir->Size) && rel->SizeOfBlock; rel = (IMAGE_BASE_RELOCATION*)((char*)rel + rel->SizeOfBlock)) { char *page = base + rel->VirtualAddress;