server: Handle duplicate handles when inheriting them for the new process.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50004
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-10-19 12:39:35 +03:00 committed by Alexandre Julliard
parent b4ca2d001c
commit 2a7a1bbee2
1 changed files with 2 additions and 1 deletions

View File

@ -363,8 +363,9 @@ static void inherit_handle( struct process *parent, const obj_handle_t handle, s
src = get_handle( parent, handle );
if (!src || !(src->access & RESERVED_INHERIT)) return;
grab_object_for_handle( src->ptr );
index = handle_to_index( handle );
if (dst[index].ptr) return;
grab_object_for_handle( src->ptr );
dst[index] = *src;
table->last = max( table->last, index );
}