Re: [PATCH] reftable/record: bound an object record's offset count by its length
- From
- Aniket 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