]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (exfat) fix divide by zero [coverity scan]
authorKarel Zak <kzak@redhat.com>
Mon, 24 Oct 2022 08:54:24 +0000 (10:54 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 24 Oct 2022 08:54:24 +0000 (10:54 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/superblocks/exfat.c

index 9d13094251c1df525065a118930539095c77ad12..3986194774c229f9da3db5d98ec7d28d395dda7d 100644 (file)
@@ -101,7 +101,7 @@ static struct exfat_entry_label *find_label(blkid_probe pr,
                        return (struct exfat_entry_label *) entry;
 
                offset += EXFAT_ENTRY_SIZE;
-               if (offset % CLUSTER_SIZE(sb) == 0) {
+               if (CLUSTER_SIZE(sb) && (offset % CLUSTER_SIZE(sb)) == 0) {
                        cluster = next_cluster(pr, sb, cluster);
                        if (cluster < EXFAT_FIRST_DATA_CLUSTER)
                                return NULL;