]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (mac) make sure block size is large enough [fuzzing]
authorKarel Zak <kzak@redhat.com>
Thu, 2 Jun 2022 14:02:54 +0000 (16:02 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Jul 2022 15:49:18 +0000 (17:49 +0200)
Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/mac.c

index 092d31d322f2cf8863d944d1f6aa4bf4e076be9d..75a558b0a3d52893057b52afc97964731e859f6c 100644 (file)
@@ -93,6 +93,8 @@ static int probe_mac_pt(blkid_probe pr,
        }
 
        block_size = be16_to_cpu(md->block_size);
+       if (block_size < sizeof(struct mac_partition))
+               goto nothing;
 
        /* The partition map always begins at physical block 1,
         * the second block on the disk.