Skip to content

Commit

Permalink
Merge branch 'rs/fetch-pack-invalid-lockfile'
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
gitster committed Dec 8, 2020
2 parents 8e2def7 + 6031af3 commit eae47db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit eae47db

Please sign in to comment.