Re: [PATCH/RFC v2 01/16] Modify cache_header to prepare for other index formats
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 7, 2012, 15:45 UTC
- Message-ID
- <7v8vdqwvsq.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120807124105.GA913@tgummerer>
Thomas Gummerer <t.gummerer@gmail.com> 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.