git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Jeff KingNext: Jeff King
Message 2 of 7 in “dir.c: skip .gitignore, etc larger than INT_MAX”
  1. dir.c: skip .gitignore, etc larger than INT_MAXJeff King, May 31, 2024
  2. Junio C HamanoMay 31, 2024
  3. Jeff KingJun 4, 2024
  4. Junio C HamanoJun 4, 2024
  5. Jeff KingJun 5, 2024
  6. Junio C HamanoJun 5, 2024
  7. Junio C HamanoMay 31, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.