]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/block: fix use of uninitialized memory when binsearch fails
authorPatrick Steinhardt <ps@pks.im>
Mon, 29 Jun 2026 09:02:22 +0000 (11:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jun 2026 15:13:38 +0000 (08:13 -0700)
commit7aef22450573e8d4202f181a4e44b1244b0ab585
tree8b9da43db3637e65e29c0a03bf7997119896c289
parent54e1285ea86b79d0d809b45c58f4ffdf071ca0e7
reftable/block: fix use of uninitialized memory when binsearch fails

When doing the binary search through our restart offsets we may hit an
error in case `restart_needle_less()` fails to decode the record at the
given offset. While we correctly detect this case and error out, it will
cause us to call `reftable_record_release()` on the yet-uninitialized
record.

Fix this by initializing the record earlier.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/block.c