]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: Check that cluster size is nonzero when probing exFAT
authorRostislav Skudnov <rostislav@tuxera.com>
Thu, 11 Aug 2016 18:24:00 +0000 (18:24 +0000)
committerKarel Zak <kzak@redhat.com>
Tue, 16 Aug 2016 10:08:46 +0000 (12:08 +0200)
This should prevent division by zero in find_label()

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
libblkid/src/superblocks/exfat.c

index 3f1e75c1383f9fcf166862e5e4099e3286ccf69c..01ed30b788c1890c207f36716a409f477b34e61f 100644 (file)
@@ -114,7 +114,7 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag)
        struct exfat_entry_label *label;
 
        sb = blkid_probe_get_sb(pr, mag, struct exfat_super_block);
-       if (!sb)
+       if (!sb || !CLUSTER_SIZE(sb))
                return errno ? -errno : BLKID_PROBE_NONE;
 
        label = find_label(pr, sb);