erofs-utils: lib: fix potential overflow issue
PATCH 1/1 erofs-utils: lib: fix potential overflow issue
Coverity-id: 502353
Change 8U to 8ULL to avoid arithmetic multiplication overflow.
Signed-off-by Hongzhen Luo <[email protected]>
--- lib/kite_deflate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kite_deflate.c +1 -1
@@ -892,7 +892,7 @@ static bool deflate_count_code(struct kite_deflate *s, bool literal, {struct kite_deflate_table *t = s->tab;unsigned int lenbase = (literal ?0 : kSymbolMatch); -u64 rem = (s->outlen - s->pos_out) *8 - s->bitpos; +u64 rem = (s->outlen - s->pos_out) *8ULL - s->bitpos;bool recalc = false;unsigned int bits;
Signature · 1 line
2.43.5