Whamcloud - gitweb
libext2fs: fix potential integer overflow in bitmap accessors
authorTheodore Ts'o <tytso@mit.edu>
Tue, 9 Aug 2022 15:16:47 +0000 (11:16 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 9 Aug 2022 15:16:47 +0000 (11:16 -0400)
commit27504bcf89193d47d7632cde922a65e0c051be01
treec584de8ce900b33f9c257cde250273067a1aa2c9
parent7464397a0c5df0416a7ef3436747045b36fb7882
libext2fs: fix potential integer overflow in bitmap accessors

bmap->cluster_bits has a maximum value of 19, but Coverity doesn't
know that.  To make it happy, and just in case there is a bug where
somehow the cluster size does get set to an invalid value and the rest
of the library doesn't check it, use 1ULL instead of 1 to avoid the
integer overflow.

Addresses-Coverity-Bug: 1500759
Addresses-Coverity-Bug: 1500764
Addresses-Coverity-Bug: 1500771
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/gen_bitmap64.c