Module: wine Branch: master Commit: 80898bfee0139bbb5d1c2efda25fc101f61d386b URL: https://source.winehq.org/git/wine.git/?a=commit;h=80898bfee0139bbb5d1c2efda...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Feb 4 11:47:51 2021 +0100
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 julliard@winehq.org
---
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;