summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-02-29 21:57:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-01 17:42:01 (GMT)
commit2a73b3dad09ef162eb5917e9e0d01d7c306f6b35 (patch)
treed3566e6ddadb7f1cdeb0a520b125e9cbac164e77 /submodule.c
parent62104ba14af4845c6c1ba1dab05fad4a289d806f (diff)
downloadgit-2a73b3dad09ef162eb5917e9e0d01d7c306f6b35.zip
git-2a73b3dad09ef162eb5917e9e0d01d7c306f6b35.tar.gz
git-2a73b3dad09ef162eb5917e9e0d01d7c306f6b35.tar.bz2
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>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/submodule.c b/submodule.c
index b83939c..916fc84 100644
--- a/submodule.c
+++ b/submodule.c
@@ -705,8 +705,7 @@ static int get_next_submodule(struct child_process *cp,
return 0;
}
-static int fetch_start_failure(struct child_process *cp,
- struct strbuf *err,
+static int fetch_start_failure(struct strbuf *err,
void *cb, void *task_cb)
{
struct submodule_parallel_fetch *spf = cb;
@@ -716,8 +715,8 @@ static int fetch_start_failure(struct child_process *cp,
return 0;
}
-static int fetch_finish(int retvalue, struct child_process *cp,
- struct strbuf *err, void *cb, void *task_cb)
+static int fetch_finish(int retvalue, struct strbuf *err,
+ void *cb, void *task_cb)
{
struct submodule_parallel_fetch *spf = cb;