Skip to content

Commit 56a30cf

Browse files
committed
osdc/Journaler.cc: fix integer overflow
Fix for: CID 1297861 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression this->layout.fl_stripe_count.operator __u32() * this->layout.fl_object_size.operator __u32() with type unsigned int (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
1 parent 1fece68 commit 56a30cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/osdc/Journaler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void Journaler::create(ceph_file_layout *l, stream_format_t const sf)
5555

5656
prezeroing_pos = prezero_pos = write_pos = flush_pos = safe_pos =
5757
read_pos = requested_pos = received_pos =
58-
expire_pos = trimming_pos = trimmed_pos = layout.fl_stripe_count * layout.fl_object_size;
58+
expire_pos = trimming_pos = trimmed_pos = (uint64_t)layout.fl_stripe_count * layout.fl_object_size;
5959

6060
ldout(cct, 1) << "created blank journal at inode 0x" << std::hex << ino << std::dec
6161
<< ", format=" << stream_format << dendl;

0 commit comments

Comments
 (0)