Skip to content

Commit eae47db

Browse files
committed
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
2 parents 8e2def7 + 6031af3 commit eae47db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fetch-pack.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,9 @@ static int get_pack(struct fetch_pack_args *args,
918918
if (start_command(&cmd))
919919
die(_("fetch-pack: unable to fork off %s"), cmd_name);
920920
if (do_keep && pack_lockfiles) {
921-
string_list_append_nodup(pack_lockfiles,
922-
index_pack_lockfile(cmd.out));
921+
char *pack_lockfile = index_pack_lockfile(cmd.out);
922+
if (pack_lockfile)
923+
string_list_append_nodup(pack_lockfiles, pack_lockfile);
923924
close(cmd.out);
924925
}
925926

0 commit comments

Comments
 (0)