Found by smatch: lib/lz4/lz4_decompress.c:150 LZ4_decompress_generic() warn: maybe use && instead of & It was realy incorrectly copied from https://github.com/lz4/lz4/commit/45f8603aae389d34c689d3ff7427b314071ccd2c line 1431
Fixes: 2209fda323e2 ("lib/lz4: update LZ4 decompressor module") Signed-off-by: Vasily Averin <v...@virtuozzo.com> --- lib/lz4/lz4_decompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c index 0c9d3ad..f7f7dca 100644 --- a/lib/lz4/lz4_decompress.c +++ b/lib/lz4/lz4_decompress.c @@ -147,7 +147,7 @@ static FORCE_INLINE int LZ4_decompress_generic( * strictly "less than" on input, to re-enter * the loop with at least one byte */ - && likely((endOnInput ? ip < shortiend : 1) & + && likely((endOnInput ? ip < shortiend : 1) && (op <= shortoend))) { /* Copy the literals */ memcpy(op, ip, endOnInput ? 16 : 8); -- 1.8.3.1