From fe9ed46859fb18ae357e09aa7d4431c12b6462d5 Mon Sep 17 00:00:00 2001 From: Riley King-Saunders Date: Tue, 23 Dec 2025 14:13:50 +1100 Subject: [PATCH] Fixed issues where WaitForMultipleObjects may hang when given a NULL process. Caused by incorrect placement into an array of valid processes. --- src/uniproc_win64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uniproc_win64.c b/src/uniproc_win64.c index 2535e75..ca0653b 100644 --- a/src/uniproc_win64.c +++ b/src/uniproc_win64.c @@ -155,8 +155,7 @@ void uniproc_await_processes(const uniproc_process* p, int* return_codes, const for (size_t i = 0; i < num_processes; ++i) { if (uniproc_is_process_null(p + i)) continue; - h[i] = (HANDLE)p[i]._proc_hdl; - num_valid_handles++; + h[num_valid_handles++] = (HANDLE)p[i]._proc_hdl; } if (num_valid_handles == 0) return; WaitForMultipleObjects(num_valid_handles, h, 1, INFINITE);