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

Re: [PATCH] xdiff: avoid arithmetic overflow in xdl_get_hunk()

From
René Scharfe <l.s.r@web.de>
Date
Mar 15, 2025, 06:38 UTC
Message-ID
<8c9a3966-2746-4619-9f77-ca95797dcab8@web.de>
In-Reply-To
<xmqqikobdz7l.fsf@gitster.g>
Am 14.03.25 um 23:28 schrieb Junio C Hamano:
Show 9 quoted lines
> René Scharfe <l.s.r@web.de> writes:
>
>>  t/t4055-diff-context.sh | 10 ++++++++++
>>  xdiff/xemit.c           |  8 +++++++-
>>  2 files changed, 17 insertions(+), 1 deletion(-)
>
> Oh, I love a patch like this that is well thought out to carefully
> check the bounds, instead of blindly say "ah, counting number of
> things in size_t solves everything" ;-)

Converting xdiff from long to size_t is still a good idea, I think, but would be lot more effort and thus more risky. Comparisons to upstream would become a lot more noisy as well.

René
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “Iffy output given git diff --unified=2147483647”
  1. Jason ChoMar 12, 2025
  2. xdiff: avoid arithmetic overflow in xdl_get_hunk()René Scharfe, Mar 14, 2025
  3. Junio C HamanoMar 14, 2025
  4. René ScharfeMar 15, 2025
  5. Junio C HamanoMar 16, 2025
  6. René ScharfeMar 17, 2025
  7. Jason ChoMar 14, 2025

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.