Patch for Debain Buster

пт, 8 нояб. 2019 г. в 11:56, Mihail Safronov <[email protected]>:

> Patches for Debian Stretch
>
> чт, 7 нояб. 2019 г. в 19:15, Mihail Safronov <[email protected]>:
>
>> Problem is more complex. When receive incomplete stream, decompression 
>> context need to be reset with LZ4F_resetDecompressionContext (added in lz4 
>> 1.8.0).
>>
>> I add simple port (this is for lz4 1.7 in CentOS 7)
>>
>> void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx)
>> {
>>     dctx->dStage = dstage_getHeader;
>>     dctx->dict = NULL;
>>     dctx->dictSize = 0;
>> }
>>
>> And with first patch problem was solved.
>>
>>
diff -uNr lz4-1.8.3.orig/lib/lz4.c lz4-1.8.3/lib/lz4.c
--- lz4-1.8.3.orig/lib/lz4.c	2019-11-08 08:27:51.607783857 +0000
+++ lz4-1.8.3/lib/lz4.c	2019-11-08 08:29:29.582497178 +0000
@@ -1432,6 +1432,8 @@
     const BYTE* const shortiend = iend - (endOnInput ? 14 : 8) /*maxLL*/ - 2 /*offset*/;
     const BYTE* const shortoend = oend - (endOnInput ? 14 : 8) /*maxLL*/ - 18 /*maxML*/;
 
+    if (src == NULL) { return -1; }
+
     DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
 
     /* Special cases */

Reply via email to