From: Junio C Hamano Date: Fri, 31 May 2024 15:05:03 GMT Subject: Re: [PATCH] dir.c: skip .gitignore, etc larger than INT_MAX Message-ID: In-Reply-To: <20240531120034.GA442032@coredump.intra.peff.net> Jeff King 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.