Skip to content

Commit b0de555

Browse files
committed
Merge branch 'maint-1.6.1' into maint
* maint-1.6.1: close_sha1_file(): make it easier to diagnose errors avoid possible overflow in delta size filtering computation
2 parents cbc8c61 + 2a5643d commit b0de555

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin-pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
12931293
max_size = trg_entry->delta_size;
12941294
ref_depth = trg->depth;
12951295
}
1296-
max_size = max_size * (max_depth - src->depth) /
1296+
max_size = (uint64_t)max_size * (max_depth - src->depth) /
12971297
(max_depth - ref_depth + 1);
12981298
if (max_size == 0)
12991299
return 0;

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,7 @@ static void close_sha1_file(int fd)
23012301
fsync_or_die(fd, "sha1 file");
23022302
fchmod(fd, 0444);
23032303
if (close(fd) != 0)
2304-
die("unable to write sha1 file");
2304+
die("error when closing sha1 file (%s)", strerror(errno));
23052305
}
23062306

23072307
/* Size of directory component, including the ending '/' */

0 commit comments

Comments
 (0)