]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (sun) make math more robust [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 11 Oct 2017 12:50:43 +0000 (14:50 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Oct 2017 12:50:43 +0000 (14:50 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/sun.c

index c0dddc862691e3dd27092963f82e4232f43a0d06..058a66372754e61b074f3148ebfedf66e8471138 100644 (file)
@@ -52,7 +52,7 @@ static int probe_sun_pt(blkid_probe pr,
                goto err;
 
        /* sectors per cylinder (partition offset is in cylinders...) */
-       spc = be16_to_cpu(l->nhead) * be16_to_cpu(l->nsect);
+       spc = (uint64_t) be16_to_cpu(l->nhead) * be16_to_cpu(l->nsect);
 
        DBG(LOWPROBE, ul_debug("Sun VTOC sanity=%u version=%u nparts=%u",
                        be32_to_cpu(l->vtoc.sanity),