uint8_t id[8];
} __attribute__((packed));
+#define HFS_SECTOR_SIZE 512
+
struct hfs_mdb {
uint8_t signature[2];
uint32_t cr_date;
static int probe_hfs(blkid_probe pr, const struct blkid_idmag *mag)
{
struct hfs_mdb *hfs;
+ int size;
hfs = blkid_probe_get_sb(pr, mag, struct hfs_mdb);
if (!hfs)
(memcmp(hfs->embed_sig, "HX", 2) == 0))
return 1; /* Not hfs, but an embedded HFS+ */
+ size = be32_to_cpu(hfs->al_blk_size);
+ if (!size || (size & (HFS_SECTOR_SIZE - 1))) {
+ DBG(LOWPROBE, ul_debug("\tbad allocation size - ignore"));
+ return 1;
+ }
+
hfs_set_uuid(pr, hfs->finder_info.id, sizeof(hfs->finder_info.id));
blkid_probe_set_label(pr, hfs->label, hfs->label_len);