run-command: do not pass child process data into callbacks
The expected way to pass data into the callback is to pass them via the customizable callback pointer. The error reporting in default_{start_failure, task_finished} is not user friendly enough, that we want to encourage using the child data for such purposes. Furthermore the struct child data is cleaned by the run-command API, before we access them in the callbacks, leading to use-after-free situations. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
62104ba14a
commit
2a73b3dad0
@ -41,7 +41,6 @@ static int no_job(struct child_process *cp,
|
||||
}
|
||||
|
||||
static int task_finished(int result,
|
||||
struct child_process *cp,
|
||||
struct strbuf *err,
|
||||
void *pp_cb,
|
||||
void *pp_task_cb)
|
||||
|
Reference in New Issue
Block a user