From f1651e9208f51dcc8ebf599e8675bbf869541130 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 3 Apr 2012 21:15:11 +0200 Subject: [PATCH] ntdll: Use the copy of the section headers for applying memory protections as well in map_image(). --- dlls/ntdll/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 450a1fb5dc0..7c2b1a93368 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1348,7 +1348,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz VIRTUAL_SetProt( view, ptr, ROUND_SIZE( 0, header_size ), VPROT_COMMITTED | VPROT_READ ); - sec = (IMAGE_SECTION_HEADER*)((char *)&nt->OptionalHeader+nt->FileHeader.SizeOfOptionalHeader); + sec = sections; for (i = 0; i < nt->FileHeader.NumberOfSections; i++, sec++) { SIZE_T size; -- 2.11.4.GIT