From 082a9ad3c3d5b50c60c7077f246e7c4675f09f9b Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 13 Jan 2025 20:14:00 +0100 Subject: [PATCH] Fix code scanning alert no. 12: Multiplication result converted to larger type (#2676) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/lib/third_party/include/binaryfusefilter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/third_party/include/binaryfusefilter.h b/src/lib/third_party/include/binaryfusefilter.h index 8326eb0346a..1e93d67ef39 100644 --- a/src/lib/third_party/include/binaryfusefilter.h +++ b/src/lib/third_party/include/binaryfusefilter.h @@ -475,7 +475,7 @@ static inline binary_hashes_t binary_fuse16_hash_batch(uint64_t hash, static inline uint32_t binary_fuse16_hash(int index, uint64_t hash, const binary_fuse16_t *filter) { uint64_t h = binary_fuse_mulhi(hash, filter->SegmentCountLength); - h += index * filter->SegmentLength; + h += (uint64_t)index * filter->SegmentLength; // keep the lower 36 bits uint64_t hh = hash & ((1ULL << 36) - 1); // index 0: right shift by 36; index 1: right shift by 18; index 2: no shift