We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 229674d + 1afc36e commit c81932eCopy full SHA for c81932e
cbits/runProcess.c
@@ -862,8 +862,10 @@ waitForJobCompletion ( HANDLE hJob )
862
JOBOBJECT_BASIC_PROCESS_ID_LIST *pid_list = NULL;
863
864
while (true) {
865
+ size_t pid_list_size = sizeof(JOBOBJECT_BASIC_PROCESS_ID_LIST) + sizeof(ULONG_PTR) * (process_count - 1);
866
+
867
if (pid_list == NULL) {
- pid_list = malloc(sizeof(JOBOBJECT_BASIC_PROCESS_ID_LIST) + sizeof(ULONG_PTR) * process_count);
868
+ pid_list = malloc(pid_list_size);
869
pid_list->NumberOfAssignedProcesses = process_count;
870
}
871
@@ -872,7 +874,7 @@ waitForJobCompletion ( HANDLE hJob )
872
874
hJob,
873
875
JobObjectBasicProcessIdList,
876
pid_list,
- sizeof(JOBOBJECT_BASIC_PROCESS_ID_LIST),
877
+ pid_list_size,
878
NULL);
879
880
if (!success && GetLastError() == ERROR_MORE_DATA) {
0 commit comments