From: Brendan Shanks bshanks@codeweavers.com
Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/ntdll/unix/virtual.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 6ecca9cb98a..acdf9de31f5 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -1904,6 +1904,8 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, { if (is_beyond_limit( base, size, address_space_limit )) return STATUS_WORKING_SET_LIMIT_RANGE; + if (is_beyond_limit( base, size, (void*)get_zero_bits_mask( zero_bits ) )) + return STATUS_CONFLICTING_ADDRESSES; status = map_fixed_area( base, size, vprot ); if (status != STATUS_SUCCESS) return status; ptr = base; @@ -2540,7 +2542,8 @@ static NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_PTR z filename = (WCHAR *)(image_info + 1); /* check if we can replace that mapping with the builtin */ res = load_builtin( image_info, filename, addr_ptr, size_ptr ); - if (res == STATUS_IMAGE_ALREADY_LOADED) + if (res == STATUS_IMAGE_ALREADY_LOADED || + is_beyond_limit( (void *)image_info->base, image_info->map_size, (void *)get_zero_bits_mask( zero_bits ) )) res = virtual_map_image( handle, access, addr_ptr, size_ptr, zero_bits, shared_file, alloc_type, image_info, filename, FALSE ); if (shared_file) NtClose( shared_file );