Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pali/util-linux
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/pali/util-linux:
  exfat: Fix parsing exfat label
  • Loading branch information
karelzak committed Feb 18, 2020
2 parents 88dbec9 + fb4ed8a commit aa506f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libblkid/src/superblocks/exfat.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit aa506f7

Please sign in to comment.