Commit a0772da5 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

ntdll: Don't try to map the PE file past the size of the backing file.

parent ae9eb36e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment