Terminate argv with NULL before calling setup_revisions()

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>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2009-05-21 19:32:44 +10:00
committed by Junio C Hamano
parent 06f391906a
commit a80aad7b85
2 changed files with 3 additions and 2 deletions

View File

@ -98,7 +98,7 @@ int verify_bundle(struct bundle_header *header, int verbose)
*/
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;