summaryrefslogtreecommitdiff
path: root/pack-check.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-11 21:21:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-11 21:21:36 (GMT)
commit6823506f364cd02589dd4485108516bd6bea8d9e (patch)
tree42a6c512d13457599649facd0e1d6a5f487c1771 /pack-check.c
parentfdb70b16a006f82b65fb92995886a074c829f587 (diff)
parenta9445d859e810cc193c1cdcb15fa684a5e9b7560 (diff)
downloadgit-6823506f364cd02589dd4485108516bd6bea8d9e.zip
git-6823506f364cd02589dd4485108516bd6bea8d9e.tar.gz
git-6823506f364cd02589dd4485108516bd6bea8d9e.tar.bz2
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
Diffstat (limited to 'pack-check.c')
-rw-r--r--pack-check.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/pack-check.c b/pack-check.c
index d123846..c5c7763 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -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 {