]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: dos: fix 32-bit overflow in partition start/size [coverity: CID 503517...
authorKarel Zak <kzak@redhat.com>
Mon, 13 Jul 2026 10:38:57 +0000 (12:38 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Jul 2026 10:38:57 +0000 (12:38 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/dos.c

index 8a2df894533e9345844ee1048ad4aaafd89a0c52..6e46105c33abd9d5f643d7581f6deaea151aa1bb 100644 (file)
@@ -138,8 +138,8 @@ static int parse_dos_extended(blkid_probe pr, blkid_parttable tab,
                 * is junk.
                 */
                for (p = p0, i = 0; i < 4; i++, p++) {
-                       start = dos_partition_get_start(p) * ssf;
-                       size = dos_partition_get_size(p) * ssf;
+                       start = (uint64_t) dos_partition_get_start(p) * ssf;
+                       size = (uint64_t) dos_partition_get_size(p) * ssf;
 
                        if (size && is_extended(p)) {
                                if (start == 0)