diff options
author | Yann Collet <cyan@fb.com> | 2018-09-10 23:22:16 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2018-09-10 23:22:16 (GMT) |
commit | 63fc6fbf7ee9e6a587598af085f22742cd9e6798 (patch) | |
tree | 937af8924de3e9c2c3a232a6cc28131b37ca0f17 | |
parent | 32272f9866eb6d46e4457190cc7562ade2aa2ca8 (diff) | |
download | lz4-63fc6fbf7ee9e6a587598af085f22742cd9e6798.zip lz4-63fc6fbf7ee9e6a587598af085f22742cd9e6798.tar.gz lz4-63fc6fbf7ee9e6a587598af085f22742cd9e6798.tar.bz2 |
restored nullifying output
to counter possible (offset==0)
-rw-r--r-- | lib/lz4.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1536,7 +1536,11 @@ LZ4_decompress_generic( _copy_match: if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error; /* Error : offset outside buffers */ - // LZ4_write32(op, (U32)offset); /* costs ~1%; silence an msan warning when offset==0 */ /* note : no longer valid with partialDecoding, since there is no guarantee that at least 4 bytes are available */ + if (!partialDecoding) { + assert(oend > op); + assert(oend - op >= 4); + LZ4_write32(op, 0); /* silence an msan warning when offset==0; costs <1%; */ + } /* note : when partialDecoding, there is no guarantee that at least 4 bytes remain available in output buffer */ if (length == ML_MASK) { unsigned s; |