Skip to content

Commit

Permalink
Guarantee the process list is always terminated
Browse files Browse the repository at this point in the history
The code for reading new processes would fail to NULL-terminate the list
if new entries were read and the target was not found.
  • Loading branch information
dra27 committed Nov 7, 2023
1 parent 19c6fa8 commit 52d48fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stubs/win32/opamWindows.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 52d48fa

Please sign in to comment.