Commit 3dfca4f3106260e75019e064dfd077e21ba8199a

Committed by

**Loic Dachary**
1 parent
71544366

Exists in
v2

### 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> (cherry picked from commit 98e5e37159f4c7634305aa65c9bc98a36488a4a9)

src/gf_w64.c

... | ... | @@ -994,7 +994,7 @@ int gf_w64_group_init(gf_t *gf) |

994 | 994 | gd->reduce = gd->shift + (1 << g_s); |

995 | 995 | |

996 | 996 | gd->reduce[0] = 0; |

997 | - for (i = 0; i < (1 << g_r); i++) { | |

997 | + for (i = 0; i < ((uint64_t)1 << g_r); i++) { | |

998 | 998 | p = 0; |

999 | 999 | index = 0; |

1000 | 1000 | for (j = 0; j < g_r; j++) { |

... | ... |