Re: [PATCH] verify_packfile: check pack validity before accessing data

2016-09-22 Thread Junio C Hamano
Jeff King writes: > So I wanted to know whether there were any code paths that failed to do > so, and just blindly rely on the lazy-open. Finding the races is > inherently hard, because you only catch them when somebody else is doing > a repack. But if we just _remove_ the

Re: [PATCH] verify_packfile: check pack validity before accessing data

2016-09-21 Thread Jeff King
On Wed, Sep 21, 2016 at 11:49:05PM -0400, Jeff King wrote: > The verify_packfile() does not explicitly open the packfile; > instead, it starts with a sha1 checksum over the whole pack, > and relies on use_pack() to open the packfile as a side > effect. > > If the pack cannot be opened for

[PATCH] verify_packfile: check pack validity before accessing data

2016-09-21 Thread Jeff King
The verify_packfile() does not explicitly open the packfile; instead, it starts with a sha1 checksum over the whole pack, and relies on use_pack() to open the packfile as a side effect. If the pack cannot be opened for whatever reason (either because its header information is corrupted, or