From: Karel Zak Date: Mon, 24 Oct 2022 08:54:24 +0000 (+0200) Subject: libblkid: (exfat) fix divide by zero [coverity scan] X-Git-Tag: v2.39-rc1~468 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48229f8e7f19c1b61a089fc9ede18d417a895454;p=thirdparty%2Futil-linux.git libblkid: (exfat) fix divide by zero [coverity scan] Signed-off-by: Karel Zak --- diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c index 9d13094251..3986194774 100644 --- a/libblkid/src/superblocks/exfat.c +++ b/libblkid/src/superblocks/exfat.c @@ -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;