Commit Graph

81 Commits

Author SHA1 Message Date
Yann Collet
45eba5b030 one more conversion warning 2019-05-29 13:17:45 -07:00
Yann Collet
76116495bf some more minor conversion warnings fixes 2019-05-29 13:14:52 -07:00
Yann Collet
c5bcb4d68b fixed minor conversion warning 2019-05-29 12:56:27 -07:00
Yann Collet
b17f578a91 added comments and macros for in-place (de)compression 2019-05-29 12:06:13 -07:00
Yann Collet
4fc6b48550 added test case for in-place compression 2019-05-29 11:19:10 -07:00
Yann Collet
ae199124e5 fixed read-after input in LZ4_decompress_safe() 2019-04-18 18:50:51 -07:00
Yann Collet
4790994568 fuzzer : reduced stack usage 2019-04-18 17:12:14 -07:00
Yann Collet
6cb084ed36 fuzzer: reduce stack usage to please Visual static analyzer 2019-04-18 17:01:36 -07:00
Yann Collet
0b876db6d4 address a few minor Visual warnings
and created target cxx17build
2019-04-18 16:07:16 -07:00
Yann Collet
4f6de46f60 fix several minor static analyzer warnings 2019-04-18 12:05:50 -07:00
Yann Collet
3f558163ad fuzzer: fixed scan-build leak warning
the program exit(),
so there is no need to track and dealloc every buffer.
2019-04-18 10:38:51 -07:00
Yann Collet
8f0e744063 fuzzer: fix explicit cast for C++ 2019-04-17 15:44:14 -07:00
Yann Collet
1ed69691a1 fuzzer: added tests to detect LZ4_decompress_fast() out of bound read 2019-04-17 13:31:24 -07:00
Norm Green
1848ea5cbd Fix AIX errors/warnings 2019-04-17 09:20:09 -07:00
Yann Collet
ce0f316989 fix fuzzer tests on dirty context
context is no longer dirty after a failed compressed block.
Actually, all indexes are fine.
It remains compatible with continued streaming, and reset*_fast().
2019-04-15 11:12:54 -07:00
Yann Collet
63bfb64b80 and even more visual conversion warnings 2019-04-12 17:40:23 -07:00
Yann Collet
d8d5f14138 fixed loadDictHC
by making a full initialization
instead of a fast reset.
2019-04-09 15:37:59 -07:00
Yann Collet
14c71dfa9c modified LZ4_initStreamHC() to look like LZ4_initStream()
it is now a pure initializer, for statically allocated states.
It can initialize any memory area, and because of this, requires size.
2019-04-09 13:55:42 -07:00
Yann Collet
2ece0d8380 created LZ4_initStream()
- promoted LZ4_resetStream_fast() to stable
- moved LZ4_resetStream() into deprecate, but without triggering a compiler warning
- update all sources to no longer rely on LZ4_resetStream()

note : LZ4_initStream() proposal is slightly different :
it's able to initialize any buffer, provided that it's large enough.
To this end, it accepts a void*, and returns an LZ4_stream_t*.
2019-04-05 12:56:26 -07:00
Yann Collet
2a94faf462 fixed _GNU_SOURCE duplicate 2019-04-05 11:55:34 -07:00
Yann Collet
a4f1635b0a fuzzer: fixed strict c99 with mmap+MAP_ANONYMOUS 2019-04-05 11:47:06 -07:00
Yann Collet
c491df54ec created LZ4_initStreamHC()
- promoted LZ4_resetStreamHC_fast() to stable
- moved LZ4_resetStreamHC() to deprecated (but do not generate a warning yet)
- Updated doc, to highlight difference between init and reset
- switched all invocations of LZ4_resetStreamHC() onto LZ4_initStreamHC()
- misc: ensure `make all` also builds /tests
2019-04-04 17:05:11 -07:00
Yann Collet
7a39fb8fb6 make _fast*() decoder generate a deprecation warning
updated modification
2019-04-04 12:47:36 -07:00
Yann Collet
186015a5d2 fixed strict C++ compilation 2019-01-09 13:45:42 -08:00
Yann Collet
baed01a9c7 fixed long sequence overflow test 2019-01-09 13:38:33 -08:00
Yann Collet
fbebf0345d minor explicit cast warning 2019-01-09 13:18:43 -08:00
Yann Collet
7741c60f98 add a test to check long sequences (#631)
the test fails, as intended,
since #631 is not merged yet in this branch.
2019-01-09 12:09:52 -08:00
Lzu Tao
b9d3080d75 clang: Fix -Wcast-qual 2018-12-02 20:30:25 +07:00
Lzu Tao
0241755dbf Fix clang warnings: -Wformat-pedantic and -Werror=overflow 2018-12-02 20:12:24 +07:00
Oleg Khabinov
f27ea0774e Adding information about dirty context for _HC_ family of functions 2018-10-10 10:33:04 -07:00
Oleg Khabinov
28eb88d988 Some followups and renamings 2018-10-01 15:19:45 -07:00
Oleg Khabinov
f2ae385c2f Rename initCheck to dirtyContext and use it in LZ4_resetStream_fast() to check if full reset is needed. 2018-09-28 14:55:05 -07:00
Yann Collet
b87a8e9e62 fixed minor warning in fuzzer.c
added a few more comments and assert()
2018-09-10 16:48:41 -07:00
Yann Collet
e22bb80074 fixed fuzzer test
and removed one blind copy, since there is no more guarantee that at least 4 bytes are still available in output buffer
2018-09-07 18:22:01 -07:00
Yann Collet
bf614d3c51 first sketch for a byte-accurate partial decoder 2018-09-07 15:44:19 -07:00
Yann Collet
30f6f34328 removed one assert() condition
which is not correct when using LZ4_HC with dictionary and starting from a low address (<0x10000).
2018-09-05 11:25:10 -07:00
Norm Green
ebe7e35601 Fix AIX 32 bit build problem of fuzzer.c 2018-06-01 11:52:22 -07:00
Yann Collet
999a8488f6 removed test that might be optimized away
under UB rule "no overflow on int"
2018-05-02 13:57:33 -07:00
Yann Collet
93cf628a08 introduce LZ4_decoderRingBufferSize()
fuzzer : fix and robustify ring buffer tests
2018-05-02 13:01:04 -07:00
Yann Collet
41ad238bf9
Merge pull request #515 from svpv/refactorDec
lz4.c: refactor the decoding routines
2018-04-29 07:41:35 -07:00
Alexey Tourbin
ce4e1389cc fuzzer.c: enabled ring buffer tests for decompress_fast
Ring buffer tests were performed only with LZ4_decompress_safe_continue,
leaving my buggy changes to LZ4_decompress_safe_continue undetected.
The tests are now replicated and performed in a similar manner for both
LZ4_decompress_safe_continue and LZ4_decompress_safe_continue (except
for the small buffer case where only one function can be tested,
because part of the dictionary is overwritten with the output).

I also updated function names in the messages (changed them to the
actual ones).  The error was reported for LZ4_decompress_safe(),
which I found misleading.
2018-04-27 07:27:10 +03:00
Yann Collet
b2637ab7b2
Merge pull request #512 from lz4/HC_dict
In-place unmutable dictionaries for LZ4HC
2018-04-24 13:18:40 -07:00
Nick Terrell
672799e814 Fix compilation error and assert. 2018-04-23 14:21:02 -07:00
Nick Terrell
bb83cad98f Fix input size validation edge cases
The bug is a read up to 2 bytes past the end of the buffer.
There are three cases for this bug, one for each test case added.

* An empty input causes `token = *ip++` to read one byte too far.
* A one byte input with `(token >> ML_BITS) == RUN_MASK` causes
  one extra byte to be read without validation. This could be
  combined with the first bug to cause 2 extra bytes to be read.
* The case pointed out in issue #508, where `ip == iend` at the
  beginning of the loop after taking the shortcut.

Benchmarks show no regressions on clang or gcc-7 on both my mac
and devserver.

Fixes #508.
2018-04-23 13:34:18 -07:00
W. Felix Handte
209c9c29d1 Add Some Simple Fuzzer Tests 2018-04-20 15:16:41 -04:00
Yann Collet
444211d259 edited a few traces for debugging 2018-04-16 17:16:08 -07:00
Yann Collet
4aff9b10b5 fixed fuzzer tests
which were modified in parallel within branc `dev`
2018-04-16 16:14:28 -07:00
Yann Collet
b5528ac86c Merge branch 'dev' into lowAddr 2018-04-16 16:12:38 -07:00
W. Felix Handte
9f0f6b89bb Further Test that ExtDictCtx Mode Produces the Exact Same Output 2018-04-13 11:50:52 -04:00
W. Felix Handte
6dd64e0776 Add Tests for LZ4_attach_dictionary and Friends 2018-04-13 11:50:52 -04:00