]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (hfs) fix make sure buffer is large enough
authorKarel Zak <kzak@redhat.com>
Thu, 2 Jun 2022 14:02:54 +0000 (16:02 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 2 Jun 2022 14:14:25 +0000 (16:14 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/superblocks/ntfs.c

index 9f1927cf74efb7e0c1b4b1cb09db070080610a6e..b5799c3e33f02ac271812858a6f6141230a0a793 100644 (file)
@@ -158,6 +158,9 @@ static int __probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag, int save_
                        sectors_per_cluster, nr_clusters,
                        off));
 
+       if (mft_record_size < 4)
+               return 1;
+
        buf_mft = blkid_probe_get_buffer(pr, off, mft_record_size);
        if (!buf_mft)
                return errno ? -errno : 1;