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
This commit is contained in:
Junio C Hamano 2016-10-11 14:21:35 -07:00
Родитель fdb70b16a0 a9445d859e
Коммит 6823506f36
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -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 {