提交 206204a1 编写于 作者: G Greg Kroah-Hartman

lz4: ensure length does not wrap

Given some pathologically compressed data, lz4 could possibly decide to
wrap a few internal variables, causing unknown things to happen.  Catch
this before the wrapping happens and abort the decompression.
Reported-by: N"Don A. Bailey" <donb@securitymouse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 206a81c1
...@@ -72,6 +72,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize) ...@@ -72,6 +72,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
len = *ip++; len = *ip++;
for (; len == 255; length += 255) for (; len == 255; length += 255)
len = *ip++; len = *ip++;
if (unlikely(length > (size_t)(length + len)))
goto _output_error;
length += len; length += len;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册