From: Karel Zak Date: Tue, 3 Dec 2019 13:49:16 +0000 (+0100) Subject: libblkid: improve vfat entries calculation [lgtm scan] X-Git-Tag: v2.35-rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d1e803b08be2d423b722b6c2353bad54b78ab39;p=thirdparty%2Futil-linux.git libblkid: improve vfat entries calculation [lgtm scan] Signed-off-by: Karel Zak --- diff --git a/libblkid/src/superblocks/vfat.c b/libblkid/src/superblocks/vfat.c index 7ea35200ff..7c01ceb022 100644 --- a/libblkid/src/superblocks/vfat.c +++ b/libblkid/src/superblocks/vfat.c @@ -361,8 +361,8 @@ static int probe_vfat(blkid_probe pr, const struct blkid_idmag *mag) /* Search the FAT32 root dir for the label attribute */ uint32_t buf_size = vs->vs_cluster_size * sector_size; uint32_t start_data_sect = reserved + fat_size; - uint32_t entries = le32_to_cpu(vs->vs_fat32_length) * - sector_size / sizeof(uint32_t); + uint32_t entries = ((uint64_t) le32_to_cpu(vs->vs_fat32_length) + * sector_size) / sizeof(uint32_t); uint32_t next = le32_to_cpu(vs->vs_root_cluster); while (next && next < entries && --maxloop) {