]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/record: don't abort when decoding invalid ref value type
authorPatrick Steinhardt <ps@pks.im>
Fri, 3 Jul 2026 12:58:47 +0000 (14:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Jul 2026 18:08:02 +0000 (11:08 -0700)
commited103ab7f89075c8cb98196b4a2577611f009def
tree08f6c9657109ee6304cc163ec3a7470178d5c628
parent657654b1aa0c4a101a55c46ab14c96bdf95dc3b7
reftable/record: don't abort when decoding invalid ref value type

When decoding a ref record we read its value type from the block. In
case the type itself is invalid we call `abort()`. This is rather
heavy-handed though: the data we're reading is untrusted, so we should
treat the issue as a normal and not as a programming error.

Fix this by handling the error gracefully. Note that this also requires
us to set the value type later, as otherwise we might store an invalid
type in the record.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/record.c
t/unit-tests/u-reftable-record.c