projects
/
platform
/
upstream
/
erofs-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ad2be3
)
erofs-utils: lib: fix potential overflow issue
author
Hongzhen Luo
<hongzhen@linux.alibaba.com>
Tue, 13 Aug 2024 12:10:23 +0000
(20:10 +0800)
committer
Gao Xiang
<hsiangkao@linux.alibaba.com>
Tue, 20 Aug 2024 07:54:40 +0000
(15:54 +0800)
Change 8U to 8ULL to avoid arithmetic multiplication overflow.
Coverity-id: 502353
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20240813121023.781122-1-hongzhen@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
lib/kite_deflate.c
patch
|
blob
|
history
diff --git
a/lib/kite_deflate.c
b/lib/kite_deflate.c
index 8581834591d15a56acc7f41dbf52e3fe0819e8be..4b1068b50b48f9d94f4550aba7efc9e64dbc9c7b 100644
(file)
--- a/
lib/kite_deflate.c
+++ b/
lib/kite_deflate.c
@@
-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) * 8
ULL
- s->bitpos;
bool recalc = false;
unsigned int bits;