]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: fix filesystem array allocation
authorKarel Zak <kzak@redhat.com>
Tue, 19 Jan 2021 13:59:01 +0000 (14:59 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 19 Jan 2021 13:59:01 +0000 (14:59 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk-mnt.c

index bd015dc5a2de355da157a2fdb946f29047201829..5635073b0fc94c45fe0f208898f5ea61561186c7 100644 (file)
@@ -60,7 +60,8 @@ static void add_filesystem(struct lsblk_device *dev, struct libmnt_fs *fs)
        assert(dev);
        assert(fs);
 
-       dev->fss = xrealloc(dev->fss, dev->nfss + 1 * sizeof(struct libmnt_fs *));
+       dev->fss = xrealloc(dev->fss, (dev->nfss + 1)
+                                       * sizeof(struct libmnt_fs *));
        dev->fss[dev->nfss] = fs;
        dev->nfss++;
        dev->is_mounted = 1;