Skip to content

Commit 6823506

Browse files
committed
Merge branch 'jk/verify-packfile-gently' into maint
A low-level function verify_packfile() was meant to show errors that were detected without dying itself, but under some conditions it didn't and died instead, which has been fixed. * jk/verify-packfile-gently: verify_packfile: check pack validity before accessing data
2 parents fdb70b1 + a9445d8 commit 6823506

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pack-check.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ static int verify_packfile(struct packed_git *p,
5757
int err = 0;
5858
struct idx_entry *entries;
5959

60-
/* Note that the pack header checks are actually performed by
61-
* use_pack when it first opens the pack file. If anything
62-
* goes wrong during those checks then the call will die out
63-
* immediately.
64-
*/
60+
if (!is_pack_valid(p))
61+
return error("packfile %s cannot be accessed", p->pack_name);
6562

6663
git_SHA1_Init(&ctx);
6764
do {

0 commit comments

Comments
 (0)