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

Re: [PATCH] reftable/record: bound an object record's offset count by its length

From
AGAniket Gupta <aniketgupta3001@gmail.com>
Date
Oct 20, 2026, 16:54 UTC
Message-ID
<20261020165442.59954-1-aniketgupta3001@gmail.com>
In-Reply-To
<atcKOhm0Kd5XryAg@pks.im>
Hi Matthew,
> By fixing that one function we also implicitly fix all the other
> callers that may currently be wrong.

I tried Patrick's change on a 32 bit build and it works for REFTABLE_ALLOC_ARRAY. However REFTABLE_CALLOC_ARRAY goes straight to reftable_calloc() with a size_t and gets truncated. I think no one passes a 64 bit count to it so nothing breaks but maybe worth a mention in the commit message?

Also the new test passes because of the count > in.len check. If that check goes away in v2 I think it might need a different test since on 64 bit nothing truncates. Maybe we can test reftable_alloc_size() directly?

Aniket
Previous: Patrick SteinhardtNext: Matthew Suozzo via GitGitGadget
Message 7 of 10 in “reftable/record: bound an object record's offset count by its length”
  1. reftable/record: bound an object record's offset count by its lengthMatthew Suozzo via GitGitGadget, Oct 14, 2026
  2. Patrick SteinhardtOct 19, 2026
  3. m@suozzo.coOct 19, 2026
  4. Patrick SteinhardtOct 20, 2026
  5. Junio C HamanoOct 20, 2026
  6. Patrick SteinhardtOct 20, 2026
  7. Aniket GuptaOct 20, 2026
  8. 0/2 reftable: widen allocation size arguments to uintmax_tMatthew Suozzo via GitGitGadget, Oct 21, 2026
  9. 1/2 Makefile: build the reftable record unit testsMatthew Suozzo via GitGitGadget, Oct 21, 2026
  10. 2/2 reftable/basics: widen allocation size arguments to uintmax_tMatthew Suozzo via GitGitGadget, Oct 21, 2026

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.