From 074b4c9170551e8338def0823102585601dd9c9c Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 7 Nov 2023 15:16:00 +0000 Subject: [PATCH] Guarantee the process list is always terminated The code for reading new processes would fail to NULL-terminate the list if new entries were read and the target was not found. --- src/stubs/win32/opamWindows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stubs/win32/opamWindows.c b/src/stubs/win32/opamWindows.c index c4132f72102..837c57c467d 100644 --- a/src/stubs/win32/opamWindows.c +++ b/src/stubs/win32/opamWindows.c @@ -680,8 +680,8 @@ CAMLprim value OPAMW_GetProcessAncestry(value unit) } cur->LowPart = entry.th32ProcessID; cur->HighPart = entry.th32ParentProcessID; + cur[1].QuadPart = 0LL; if (cur->LowPart == target) { - cur[1].QuadPart = 0LL; break; } else { cur++;