Re: [PATCH] dir.c: skip .gitignore, etc larger than INT_MAX
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 31, 2024, 15:05 UTC
- Message-ID
- <xmqqh6eehvj4.fsf@gitster.g>
- In-Reply-To
- <20240531120034.GA442032@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> The "int" in question is in add_patterns_from_buffer(), so we could > catch it there. But by putting the checks in its two callers, we can > produce more useful error messages.
Nice trick. I wondered if we want INT_MAX/2 or something even lower, but because once these things are read, we only parse the contents so allowing up to INT_MAX is fine. It is not like we read this and that and concatenate them into a larger buffer.