Skip to content

Commit 2a5643d

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

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
@@ -2298,7 +2298,7 @@ static void close_sha1_file(int fd)
22982298
fsync_or_die(fd, "sha1 file");
22992299
fchmod(fd, 0444);
23002300
if (close(fd) != 0)
2301-
die("unable to write sha1 file");
2301+
die("error when closing sha1 file (%s)", strerror(errno));
23022302
}
23032303

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

0 commit comments

Comments
 (0)