From e526f503918cc29d8b1ccf36a5c3a34645d2be6e Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Thu, 9 Nov 2017 19:03:34 +0100 Subject: libblkid: vfat: Fix reading labels which starts with byte 0x05 When FAT directory entry has leading byte 0x05 it is interpreted as byte 0xE5. This is how FAT stores file name which starts with byte 0xE5 as leading byte in 0xE5 in FAT directory entry means that file slot is empty. Fixes: #533 --- libblkid/src/superblocks/vfat.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libblkid') diff --git a/libblkid/src/superblocks/vfat.c b/libblkid/src/superblocks/vfat.c index 0cdd2bac7..3aeba018a 100644 --- a/libblkid/src/superblocks/vfat.c +++ b/libblkid/src/superblocks/vfat.c @@ -165,6 +165,8 @@ static unsigned char *search_fat_label(blkid_probe pr, if ((ent->attr & (FAT_ATTR_VOLUME_ID | FAT_ATTR_DIR)) == FAT_ATTR_VOLUME_ID) { DBG(LOWPROBE, ul_debug("\tfound fs LABEL at entry %d", i)); + if (ent->name[0] == 0x05) + ent->name[0] = 0xE5; return ent->name; } } -- cgit v1.2.3-55-g7522