]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: btrfs - avoid calling clz with zero argument
authorMilan Broz <gmazyland@gmail.com>
Mon, 10 Oct 2022 06:29:22 +0000 (08:29 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Oct 2022 08:28:26 +0000 (10:28 +0200)
commita40629211df83088fb2da3300921dbe3da59be48
tree48cea83a5e5375f3be91107592a98b5ec9bb47bd
parentd7fa8ed63891b0058c5df8aa809e34de61008f51
libblkid: btrfs - avoid calling clz with zero argument

If btrfs superblock contains unknown checksum type,
the values are parsed anyway.

Bogus sector size then can lead to clz() with zero argument
(this is undefined).

Reproducer found with OSS-Fuzz (issue 52286) running over
cryptsetup project (blkid is used in header init).
libblkid/src/superblocks/btrfs.c