gf_w64.c: fix integer overflow
Fix for Coverity issue (from Ceph): CID 1193086 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression 1 << g_r with type int (32 bits, signed) 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>master
parent
7972291e1f
commit
98e5e37159
|
@ -994,7 +994,7 @@ int gf_w64_group_init(gf_t *gf)
|
|||
gd->reduce = gd->shift + (1 << g_s);
|
||||
|
||||
gd->reduce[0] = 0;
|
||||
for (i = 0; i < (1 << g_r); i++) {
|
||||
for (i = 0; i < ((uint64_t)1 << g_r); i++) {
|
||||
p = 0;
|
||||
index = 0;
|
||||
for (j = 0; j < g_r; j++) {
|
||||
|
|
Loading…
Reference in New Issue