From 80898bfee0139bbb5d1c2efda25fc101f61d386b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 4 Feb 2021 11:47:51 +0100 Subject: [PATCH] ntdll: Fix loading of section table in get_cor_header(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50613 Signed-off-by: Alexandre Julliard --- dlls/ntdll/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 464b69427d5..458f79a9197 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2040,7 +2040,7 @@ static BOOL get_cor_header( HANDLE file, const SECTION_IMAGE_INFORMATION *info, va = nt.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress; size = nt.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].Size; if (!va || size < sizeof(*cor)) return FALSE; - offset.QuadPart = offsetof( IMAGE_NT_HEADERS32, OptionalHeader ) + nt.FileHeader.SizeOfOptionalHeader; + offset.QuadPart += offsetof( IMAGE_NT_HEADERS32, OptionalHeader ) + nt.FileHeader.SizeOfOptionalHeader; count = min( 96, nt.FileHeader.NumberOfSections ); if (NtReadFile( file, 0, NULL, NULL, &io, &sec, count * sizeof(*sec), &offset, NULL )) return FALSE; if (io.Information != count * sizeof(*sec)) return FALSE;