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

Alexandre Julliard julliard at winehq.org
Mon Oct 19 15:54:06 CDT 2020


Module: wine
Branch: master
Commit: 2a7a1bbee2116d1ec242920c68fa12dfdf747347
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2a7a1bbee2116d1ec242920c68fa12dfdf747347

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Oct 19 12:39:35 2020 +0300

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/handle.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/handle.c b/server/handle.c
index 15382256f10..2556a03901e 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -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 );
 }




More information about the wine-cvs mailing list