Skip to content

Commit

Permalink
Fix reading from uninitialized pid
Browse files Browse the repository at this point in the history
  • Loading branch information
arhadthedev authored Apr 12, 2023
1 parent d070f06 commit 7251169
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
PyObject *converted_args = NULL, *fast_args = NULL;
PyObject *preexec_fn_args_tuple = NULL;
gid_t *extra_groups = NULL;
pid_t pid = -1;
PyObject *cwd_obj2 = NULL;
const char *cwd = NULL;
int need_to_reenable_gc = 0;
Expand Down Expand Up @@ -1066,7 +1067,7 @@ subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
}
#endif

pid_t pid = do_fork_exec(exec_array, argv, envp, cwd,
pid = do_fork_exec(exec_array, argv, envp, cwd,
p2cread, p2cwrite, c2pread, c2pwrite,
errread, errwrite, errpipe_read, errpipe_write,
close_fds, restore_signals, call_setsid, pgid_to_set,
Expand Down

0 comments on commit 7251169

Please sign in to comment.