summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06f3919)
raw | patch | inline | side by side (parent: 06f3919)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Thu, 21 May 2009 09:32:44 +0000 (19:32 +1000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 21 May 2009 15:56:24 +0000 (08:56 -0700) |
It is convention that argv should be terminated with NULL, even if
argc is used to specify the size of argv. setup_revisions() requires
this and may segfault otherwise.
This patch makes sure that all argv (that I can find) is NULL terminated.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
argc is used to specify the size of argv. setup_revisions() requires
this and may segfault otherwise.
This patch makes sure that all argv (that I can find) is NULL terminated.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle.c | patch | blob | history | |
http-push.c | patch | blob | history |
diff --git a/bundle.c b/bundle.c
index d0dd818b31faa04caa4d418a39ad3020a919aa2d..e4b2aa9c4a2a7fb52121828343aa27ab47d17279 100644 (file)
--- a/bundle.c
+++ b/bundle.c
*/
struct ref_list *p = &header->prerequisites;
struct rev_info revs;
- const char *argv[] = {NULL, "--all"};
+ const char *argv[] = {NULL, "--all", NULL};
struct object_array refs;
struct commit *commit;
int i, ret = 0, req_nr;
diff --git a/http-push.c b/http-push.c
index 29e8ebfebb8947cc76b5631ae143d0003e5b3d51..dac2c6e0524e3051ca98bfb4d75fbc81efe91eef 100644 (file)
--- a/http-push.c
+++ b/http-push.c
new_refs = 0;
for (ref = remote_refs; ref; ref = ref->next) {
char old_hex[60], *new_hex;
- const char *commit_argv[4];
+ const char *commit_argv[5];
int commit_argc;
char *new_sha1_hex, *old_sha1_hex;
commit_argv[3] = old_sha1_hex;
commit_argc++;
}
+ commit_argv[commit_argc] = NULL;
init_revisions(&revs, setup_git_directory());
setup_revisions(commit_argc, commit_argv, &revs, NULL);
revs.edge_hint = 0; /* just in case */