]> git.ipfire.org Git - thirdparty/git.git/commit - fsck.c
fsck: refactor `fsck_blob()` to allow for more checks
authorPatrick Steinhardt <ps@pks.im>
Thu, 1 Dec 2022 14:45:57 +0000 (15:45 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Dec 2022 08:05:00 +0000 (17:05 +0900)
commitbb3a9265e505e9593faa260860f9b8929af0963e
tree7dda05e84e8c8bf639ff989e5bcabc2307052144
parente0bfc0b3b91052a5807b66aea866648087b30b80
fsck: refactor `fsck_blob()` to allow for more checks

In general, we don't need to validate blob contents as they are opaque
blobs about whose content Git doesn't need to care about. There are some
exceptions though when blobs are linked into trees so that they would be
interpreted by Git. We only have a single such check right now though,
which is the one for gitmodules that has been added in the context of
CVE-2018-11235.

Now we have found another vulnerability with gitattributes that can lead
to out-of-bounds writes and reads. So let's refactor `fsck_blob()` so
that it is more extensible and can check different types of blobs.

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