]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: mac: use 64-bit for partition offset calculations
authorKarel Zak <kzak@redhat.com>
Wed, 15 Apr 2026 18:36:41 +0000 (20:36 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 23 Apr 2026 12:07:45 +0000 (14:07 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/mac.c

index 36ce74ed3fbb070309865ab954410207dea7a109..022099251e06a9db14a591eefde1f38503c586f0 100644 (file)
@@ -134,8 +134,8 @@ static int probe_mac_pt(blkid_probe pr,
 
        for (i = 0; i < nprts; ++i) {
                blkid_partition par;
-               uint32_t start;
-               uint32_t size;
+               uint64_t start;
+               uint64_t size;
 
                p = (struct mac_partition *) get_mac_block(pr, block_size, i + 1);
                if (!p) {
@@ -160,8 +160,8 @@ static int probe_mac_pt(blkid_probe pr,
                 * follows Linux kernel and all partitions are visible
                 */
 
-               start = be32_to_cpu(p->start_block) * ssf;
-               size = be32_to_cpu(p->block_count) * ssf;
+               start = (uint64_t) be32_to_cpu(p->start_block) * ssf;
+               size = (uint64_t) be32_to_cpu(p->block_count) * ssf;
 
                par = blkid_partlist_add_partition(ls, tab, start, size);
                if (!par)