Re: [PATCH/RFC v2 01/16] Modify cache_header to prepare for other index formats
From: Junio C Hamano <hidden> Date: 2016-06-15 22:54:26
Thomas Gummerer [off-list ref] writes:
This part is called even before we know what version of the index
we will read, and before the file is mmaped. The best solution
i think is to drop the check and just call verify_hdr, ...
Exactly. And do the length checking inside verify_hdr() or its
callee where we know what the minimum length is depending on the
version as necessary to avoid over-reading.