From: Pali Rohár Date: Wed, 12 Feb 2020 17:08:46 +0000 (+0100) Subject: exfat: Fix parsing exfat label X-Git-Tag: v2.36-rc1~224^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb4ed8a511dacfac40d5dc8fae6a7ee78c069e38;p=thirdparty%2Futil-linux.git exfat: Fix parsing exfat label According to released exfat specification, label is only 22 bytes long. --- diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c index 7622320d39..62fb8ce0b8 100644 --- a/libblkid/src/superblocks/exfat.c +++ b/libblkid/src/superblocks/exfat.c @@ -33,7 +33,8 @@ struct exfat_super_block { struct exfat_entry_label { uint8_t type; uint8_t length; - uint8_t name[30]; + uint8_t name[22]; + uint8_t reserved[8]; } __attribute__((__packed__)); #define BLOCK_SIZE(sb) (1u << (sb)->block_bits) @@ -125,7 +126,8 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag) label = find_label(pr, sb); if (label) blkid_probe_set_utf8label(pr, label->name, - min(label->length * 2, 30), BLKID_ENC_UTF16LE); + min(label->length * 2, sizeof(label->name)), + BLKID_ENC_UTF16LE); else if (errno) return -errno;