Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 206204a1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatar"Don A. Bailey" <donb@securitymouse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 206a81c1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
			len = *ip++;
			for (; len == 255; length += 255)
				len = *ip++;
			if (unlikely(length > (size_t)(length + len)))
				goto _output_error;
			length += len;
		}