]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/HashIndex.cc: fix unintentional integer overflow
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 4 Sep 2014 12:36:18 +0000 (14:36 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 4 Sep 2014 12:36:18 +0000 (14:36 +0200)
commit6b70483232de10d67f6b4533be691dfcd4d31565
tree3513d3360ac3811b7fd76ad9a788b33dafc367dc
parentf29e5b338233e39a2ecd59ae3b23d85e11ce7f27
os/HashIndex.cc: fix unintentional integer overflow

CID 1232604 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
 overflow_before_widen: Potentially overflowing expression
 (unsigned int)abs(this->merge_threshold) * 16U * this->split_multiplier
 with type unsigned int (32 bits, unsigned) is evaluated using 32-bit
 arithmetic before being used in a context which expects an expression of
 type uint64_t const (64 bits, unsigned). To avoid overflow, cast either
 operand to uint64_t const before performing the multiplication.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/os/HashIndex.cc