Module: wine Branch: master Commit: a0772da5cf507b10800d5358554d682f82f48724 URL: https://source.winehq.org/git/wine.git/?a=commit;h=a0772da5cf507b10800d53585...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Wed May 6 15:15:56 2020 +0800
ntdll: Don't try to map the PE file past the size of the backing file.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42125 Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/virtual.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 7700385eb7..399b0de41f 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1588,6 +1588,7 @@ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, int top_ /* unaligned sections, this happens for native subsystem binaries */ /* in that case Windows simply maps in the whole file */
+ total_size = min( total_size, ROUND_SIZE( 0, st.st_size )); if (map_file_into_view( view, fd, 0, total_size, 0, VPROT_COMMITTED | VPROT_READ | VPROT_WRITECOPY, removable ) != STATUS_SUCCESS) goto error;