summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2019-12-17 08:28:35 +0100
committerRafał Miłecki <rafal@milecki.pl>2019-12-20 07:44:23 +0100
commitf43a1aa6655b702e690179130b3c3fe40b73aaa2 (patch)
treef958c834aad660c2f0521172054c6c337f529249
parent157924dfca61d37f29017ebb4a5eab8137a0cd27 (diff)
downloadfstools-f43a1aa6655b702e690179130b3c3fe40b73aaa2.tar.gz
libblkid-tiny: vfat: Fix reading labels which starts with byte 0x05
commit e526f503918cc29d8b1ccf36a5c3a34645d2be6e upstream. 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
-rw-r--r--libblkid-tiny/vfat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libblkid-tiny/vfat.c b/libblkid-tiny/vfat.c
index 49b865a..93e4053 100644
--- a/libblkid-tiny/vfat.c
+++ b/libblkid-tiny/vfat.c
@@ -167,6 +167,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;
}
}