]> sourceware.org Git - lvm2.git/commitdiff
cov: avoid expression overflow
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 9 Aug 2024 11:06:01 +0000 (13:06 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 9 Aug 2024 11:20:44 +0000 (13:20 +0200)
Use 64bit math to multiply extent_size.

lib/metadata/integrity_manip.c

index 3a186bec18202f28ff694dedc21abd3ad9202245..809bddf03d1460113f4ad9d5b7470d7dd50b2d7a 100644 (file)
@@ -63,7 +63,7 @@ static uint64_t _lv_size_bytes_to_integrity_meta_bytes(uint64_t lv_size_bytes, u
                /* for calculating the metadata LV size for the specified
                   journal size, round the specified journal size up to the
                   nearest extent.  extent_size is in sectors. */
-               initial_bytes = dm_round_up(journal_sectors, extent_size) * 512;
+               initial_bytes = dm_round_up(journal_sectors, (int64_t)extent_size) * 512;
                goto out;
        }
 
This page took 0.030347 seconds and 5 git commands to generate.