]> git.ipfire.org Git - thirdparty/git.git/commit
unpack-trees: detect mismatching number of cache-tree/index entries
authorPatrick Steinhardt <ps@pks.im>
Mon, 7 Oct 2024 04:38:21 +0000 (06:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Oct 2024 22:08:11 +0000 (15:08 -0700)
commitecb5c4318cd8b5bbb72f943b6128fe946ffcb56e
treeebc6d28a99acd59267d413d1c1f4a6b06847f1e9
parent2be7fc012e6747160b4b6586a1ec209598581ade
unpack-trees: detect mismatching number of cache-tree/index entries

Same as the preceding commit, we unconditionally dereference the index's
cache entries depending on the number of cache-tree entries, which can
lead to a segfault when the cache-tree is corrupted. Fix this bug.

This also makes t4058 pass with the leak sanitizer enabled.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4058-diff-duplicates.sh
unpack-trees.c