Neither of these two warnings can actually happen (other limits will
be hit first), but widening the integer to a 64-bit unsigned integer
is an cheap and effective way to silence the Coverity warnings.
Addresses-Coverity-Bug: 1500760
Addresses-Coverity-Bug: 1507886
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
header->refcount_table_clusters =
ext2fs_cpu_to_be32(image->refcount.refcount_table_clusters);
offset += image->cluster_size;
- offset += image->refcount.refcount_table_clusters <<
+ offset += (blk64_t) image->refcount.refcount_table_clusters <<
image->cluster_bits;
/* Make space for L2 tables */
/* If using cluster allocations, trim down to a cluster boundary */
if (ext2fs_has_feature_bigalloc(fs->super)) {
- new_size &= ~((blk64_t)(1 << fs->cluster_ratio_bits) - 1);
+ new_size &= ~((blk64_t)(1ULL << fs->cluster_ratio_bits) - 1);
}
new_group_desc_count = ext2fs_div64_ceil(new_size -