diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-12-09 02:11:20 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-09 02:11:20 +0300 |
commit | eae47db8657199518b0785db6d83cf9fec179b47 (patch) | |
tree | c09f513ef57e9d642d61c4c2fd76edba08f706f6 /fetch-pack.c | |
parent | 8e2def76f76cdf531034d13170e317afeb100d23 (diff) | |
parent | 6031af387e7d0554d3202e0039d9d9af1691a6a4 (diff) |
Merge branch 'rs/fetch-pack-invalid-lockfile'
"fetch-pack" could pass NULL pointer to unlink(2) when it sees an
invalid filename; the error checking has been tightened to make
this impossible.
* rs/fetch-pack-invalid-lockfile:
fetch-pack: disregard invalid pack lockfiles
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index 23179b8dd0..876f90c759 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -918,8 +918,9 @@ static int get_pack(struct fetch_pack_args *args, if (start_command(&cmd)) die(_("fetch-pack: unable to fork off %s"), cmd_name); if (do_keep && pack_lockfiles) { - string_list_append_nodup(pack_lockfiles, - index_pack_lockfile(cmd.out)); + char *pack_lockfile = index_pack_lockfile(cmd.out); + if (pack_lockfile) + string_list_append_nodup(pack_lockfiles, pack_lockfile); close(cmd.out); } |