From cd1e89459fa35b4787af821fbed939c57dc436ad Mon Sep 17 00:00:00 2001 From: Rostislav Skudnov Date: Thu, 11 Aug 2016 18:24:00 +0000 Subject: [PATCH] libblkid: Check that cluster size is nonzero when probing exFAT This should prevent division by zero in find_label() Signed-off-by: Rostislav Skudnov --- libblkid/src/superblocks/exfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c index 3f1e75c138..01ed30b788 100644 --- a/libblkid/src/superblocks/exfat.c +++ b/libblkid/src/superblocks/exfat.c @@ -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); -- 2.47.2