]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: improve vfat entries calculation [lgtm scan]
authorKarel Zak <kzak@redhat.com>
Tue, 3 Dec 2019 13:49:16 +0000 (14:49 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Dec 2019 13:49:16 +0000 (14:49 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/superblocks/vfat.c

index 7ea35200ffdc4cbb10a30a4f7a35607db8020841..7c01ceb02222bcc6f4f9e328163c4b363f71a081 100644 (file)
@@ -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) {