Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-30 02:57:13 +0300
committerJunio C Hamano <gitster@pobox.com>2016-09-30 02:57:13 +0300
commit5c2c2d4aeed92ce047e889f415b513e1ee6ac3de (patch)
treef64665074bea202486126ebad6559f98f9711c7e /pack-check.c
parent4cff50b3fb50940e57dc10769b2f92d5cec1a05a (diff)
parenta9445d859e810cc193c1cdcb15fa684a5e9b7560 (diff)
Merge branch 'jk/verify-packfile-gently'
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 d123846ea2..c5c7763323 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 {