diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-12-09 00:11:20 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-09 00:11:20 +0100 |
commit | eae47db8657199518b0785db6d83cf9fec179b47 (patch) | |
tree | c09f513ef57e9d642d61c4c2fd76edba08f706f6 /fetch-pack.c | |
parent | Merge branch 'nk/perf-fsmonitor-cleanup' (diff) | |
parent | fetch-pack: disregard invalid pack lockfiles (diff) | |
download | git-eae47db8657199518b0785db6d83cf9fec179b47.tar.xz git-eae47db8657199518b0785db6d83cf9fec179b47.zip |
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); } |