Skip to content

Commit

Permalink
Merge branch 'jk/verify-packfile-gently'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Sep 29, 2016
2 parents 4cff50b + a9445d8 commit 5c2c2d4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pack-check.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ static int verify_packfile(struct packed_git *p,
int err = 0;
struct idx_entry *entries;

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

git_SHA1_Init(&ctx);
do {
Expand Down

0 comments on commit 5c2c2d4

Please sign in to comment.