summaryrefslogtreecommitdiff
path: root/lib/lz4/lz4_decompress.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-24 00:05:28 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-24 00:05:28 (GMT)
commit8b8f5d9715845f9ae2b89ce406e71877965b29ca (patch)
tree2d8052aaec3138e5871ad675cf15370fbf27f1ac /lib/lz4/lz4_decompress.c
parent04b5da4a14eef2ed1b92fd762be80fa1ba7a6461 (diff)
parent206204a1162b995e2185275167b22468c00d6b36 (diff)
downloadlinux-8b8f5d9715845f9ae2b89ce406e71877965b29ca.tar.xz
Merge tag 'compress-3.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull compress bugfixes from Greg KH: "Here are two bugfixes for some compression functions that resolve some errors when uncompressing some pathalogical data. Both were found by Don A Bailey" * tag 'compress-3.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: lz4: ensure length does not wrap lzo: properly check for overruns
Diffstat (limited to 'lib/lz4/lz4_decompress.c')
-rw-r--r--lib/lz4/lz4_decompress.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c
index df6839e..99a03ac 100644
--- a/lib/lz4/lz4_decompress.c
+++ b/lib/lz4/lz4_decompress.c
@@ -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;
}