Re: [PATCH v2 11/24] pack-bitmap.c: introduce 'nth_bitmap_object_oid()'
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jun 24, 2021, 14:59 UTC
- Message-ID
- <YNSdzWSb8pZv1xWg@nand.local>
- In-Reply-To
- <ac1f46aa1f0dbc7fba45229555b11b390fe104a0.1624314293.git.me@ttaylorr.com>
On Mon, Jun 21, 2021 at 06:25:26PM -0400, Taylor Blau wrote:
Show 11 quoted lines
> static int load_bitmap_entries_v1(struct bitmap_index *index)
> {
> uint32_t i;
> @@ -242,9 +249,7 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
> xor_offset = read_u8(index->map, &index->map_pos);
> flags = read_u8(index->map, &index->map_pos);
>
> - if (nth_packed_object_id(&oid, index->pack, commit_idx_pos) < 0)
> - return error("corrupt ewah bitmap: commit index %u out of range",
> - (unsigned)commit_idx_pos);
> + nth_bitmap_object_oid(index, &oid, commit_idx_pos);Oops. I was reading code in this area and noticed that this patch drops the check introduced by c6b0c3910c (pack-bitmap.c: check reads more aggressively when loading, 2020-12-08).
I fixed it up locally by restoring the check (but on the new function nth_bitmap_object_oid() instead), and will send it in a reroll.
Thanks, Taylor