git/reftable
Patrick Steinhardt f9e88544f5 reftable/block: fix error handling when searching restart points
When doing the binary search over restart points in a block we need to
decode the record keys. This decoding step can result in an error when
the block is corrupted, which we indicate to the caller of the binary
search by setting `args.error = 1`. But the only caller that exists
mishandles this because it in fact performs the error check before
calling `binsearch()`.

Fix this bug by checking for errors at the right point in time.
Furthermore, refactor `binsearch()` so that it aborts the search in case
the callback function returns a negative value so that we don't
needlessly continue to search the block.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-04-03 09:16:50 -07:00
..
LICENSE
basics.c reftable/block: fix error handling when searching restart points 2024-04-03 09:16:50 -07:00
basics.h reftable/block: fix error handling when searching restart points 2024-04-03 09:16:50 -07:00
basics_test.c reftable/basics: improve `binsearch()` test 2024-04-03 09:16:49 -07:00
block.c reftable/block: fix error handling when searching restart points 2024-04-03 09:16:50 -07:00
block.h reftable/record: use scratch buffer when decoding records 2024-03-05 09:10:06 -08:00
block_test.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
blocksource.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
blocksource.h
constants.h
dump.c
error.c
generic.c
generic.h
iter.c reftable/merged: remove unnecessary null check for subiters 2024-03-04 10:19:39 -08:00
iter.h reftable/merged: remove unnecessary null check for subiters 2024-03-04 10:19:39 -08:00
merged.c reftable/merged: avoid duplicate pqueue emptiness check 2024-03-04 10:19:40 -08:00
merged.h reftable/merged: make `merged_iter` structure private 2024-03-04 10:19:30 -08:00
merged_test.c reftable/record: convert old and new object IDs to arrays 2024-03-05 09:10:06 -08:00
pq.c reftable: allow inlining of a few functions 2024-03-04 10:19:49 -08:00
pq.h reftable: allow inlining of a few functions 2024-03-04 10:19:49 -08:00
pq_test.c reftable/merged: make subiters own their records 2024-03-04 10:19:39 -08:00
publicbasics.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
reader.c Merge branch 'ps/reftable-iteration-perf' 2024-02-26 18:10:24 -08:00
reader.h
readwrite_test.c reftable/record: convert old and new object IDs to arrays 2024-03-05 09:10:06 -08:00
record.c Merge branch 'ps/reftable-reflog-iteration-perf' 2024-03-21 14:55:13 -07:00
record.h reftable/record: use scratch buffer when decoding records 2024-03-05 09:10:06 -08:00
record_test.c reftable/record: use scratch buffer when decoding records 2024-03-05 09:10:06 -08:00
refname.c reftable/refname: refactor binary search over refnames 2024-04-03 09:16:50 -07:00
refname.h
refname_test.c
reftable-blocksource.h
reftable-error.h
reftable-generic.h
reftable-iterator.h
reftable-malloc.h
reftable-merged.h reftable/stack: use `size_t` to track stack length 2024-02-06 12:10:08 -08:00
reftable-reader.h
reftable-record.h reftable/record: reuse message when decoding log records 2024-03-05 09:10:06 -08:00
reftable-stack.h
reftable-tests.h
reftable-writer.h
stack.c reftable/stack: register compacted tables as tempfiles 2024-03-07 12:34:14 -08:00
stack.h reftable/stack: index segments with `size_t` 2024-02-06 12:10:08 -08:00
stack_test.c reftable/record: convert old and new object IDs to arrays 2024-03-05 09:10:06 -08:00
system.h reftable/stack: register lockfiles during compaction 2024-03-07 12:34:13 -08:00
test_framework.c
test_framework.h
tree.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
tree.h
tree_test.c
writer.c Merge branch 'ps/reftable-styles' 2024-02-12 13:16:10 -08:00
writer.h