Commit Graph

2434 Commits

Author SHA1 Message Date
Yann Collet
a88c8fb438 make it possible to select SCANBUILD binary on command line 2020-10-01 23:27:02 -07:00
Yann Collet
1e5ff76b36 add LZ4F_decompress() tests with (NULL,0) input and output
fix one (rare & complex) issue discovered by this test
2020-10-01 21:10:08 -07:00
Yann Collet
0aed7314de
Merge pull request #924 from lz4/safixes
fix minor static analyzer warnings
2020-10-01 12:53:27 -07:00
Yann Collet
03f006a7ea make scan-build accept assert() 2020-10-01 10:48:22 -07:00
Yann Collet
1e31f1d25c fix bad init scenario 2020-09-30 22:51:17 -07:00
Yann Collet
fe74eb2031 added memcpy() related SA warning fixes
memcpy() on NULL is UB, even if length is 0.
2020-09-30 21:20:07 -07:00
Yann Collet
d9619f55ef Merge branch 'safixes' of github.com:lz4/lz4 into safixes 2020-09-30 00:23:47 -07:00
Yann Collet
7d21f761c3 fix conversion warning 2020-09-29 21:53:42 -07:00
Yann Collet
40cc3aa9a2 Merge branch 'dev' into safixes 2020-09-29 17:21:59 -07:00
Yann Collet
ad2d2764c7 fix minor static analyzer warnings
detected by scan-build, cppcheck and advanved compilation flags
fix #786
2020-09-29 17:20:52 -07:00
Yann Collet
392809d66e fix minor static analyzer warnings
detected by scan-build and cppcheck
fix #786
2020-09-29 17:09:58 -07:00
Yann Collet
293713a4fa bump version number
to v1.9.3
2020-09-29 14:27:39 -07:00
Yann Collet
78f4fdbb89
Merge pull request #923 from lz4/fix784
fix efficiency of LZ4_compress_HC_destSize()
2020-09-28 14:04:56 -07:00
Yann Collet
ab89dda91d improved last literals run on LZ4_compress_destSize
applying new more accurate formula from LZ4_compress_HC_destSize()

also : fix some minor display issue in tests/frametest
2020-09-28 11:39:00 -07:00
Yann Collet
89736e4e27 ensure last match not too close to end
must respect MFLIMIT distance from oend
2020-09-27 23:59:56 -07:00
Yann Collet
a13c79d56d fix incorrect counting
after truncation of last sequence
2020-09-27 22:47:05 -07:00
Yann Collet
8a362a8ac8
Merge pull request #921 from lz4/doubleNull
fix compressing into NULL
2020-09-27 21:09:06 -07:00
Yann Collet
21062b063f
Merge pull request #922 from XVilka/tinycc-support
Fix compilation with TinyCC
2020-09-27 21:08:26 -07:00
Yann Collet
e7fe105ac6 fix efficiency of LZ4_compress_HC_destSize()
LZ4_compress_HC_destSize() had a tendency
to discard its last match when this match overflowed specified dstBuffer limit.
The impact is generally moderate,
but occasionally huge,
typically when this last match is very large
(such as compressing a bunch of zeroes).

Issue #784 fixed for both Chain and Opt implementations.

Added a unit test suggested by @remittor checking this topic.
2020-09-27 21:04:40 -07:00
Anton Kochkov
9730d91110 Fix compilation with TinyCC 2020-09-27 17:07:51 +08:00
Yann Collet
ee4f37d284 fix compressing into NULL
fails properly
bug discovered by oss-fuzz
2020-09-26 11:31:57 -07:00
Yann Collet
20856da7c5
Merge pull request #919 from attilaolah/cli
Add CMake option LZ4_BUILD_CLI
2020-09-23 08:23:59 -07:00
Attila Oláh
63942cdeba
Add CMake option LZ4_BUILD_CLI.
Defaults to ON so nothing changes, but it can be set to OFF so that the
CLI is not built at all, only the library.
2020-09-23 12:56:01 +00:00
Yann Collet
dc27b7ae41 comment bug on older versions of ZSTD_compress_destSize()
following investigation in #859
2020-09-17 20:59:01 -07:00
Yann Collet
d568a6d15c
Merge pull request #918 from lz4/usan_null
Properly fix #847
2020-09-17 20:23:06 -07:00
Yann Collet
4f57219a22 fixed ubsan tests with dynamic library 2020-09-17 16:49:21 -07:00
Yann Collet
b223f11b21 ubsan: make pointer overflow recoverable
the way `base` is used must allow 2-complement address overflow.
`base` is effectively a virtual pointer, never dereferenced directly.
What matters is `base + index`.
This is the address that will be dereference and must be valid (it is properly validated).
2020-09-17 15:34:03 -07:00
Yann Collet
10d2e1c694 fixed lz4frame with blocks of size 1
properly track history
2020-09-17 14:43:02 -07:00
Yann Collet
43bbb7decc Merge branch 'usan_null' of github.com:Cyan4973/lz4 into usan_null 2020-09-17 10:38:59 -07:00
Yann Collet
cfd1d8f9d0 Merge branch 'usan_null' of github.com:lz4/lz4 into usan_null 2020-09-17 10:32:05 -07:00
Yann Collet
b4a64e0eac fix ubsan test
which now fails with a clear error as intended
(not just print a status and move on).
should be reproduced on travisCI
2020-09-17 10:29:31 -07:00
Yann Collet
ee01df1271 added the actual code change 2020-09-16 23:46:39 -07:00
Yann Collet
1328c38a15
Merge pull request #913 from lz4/usan_null
fix #847
2020-09-16 23:24:41 -07:00
Yann Collet
da1272979f fix #847
support NULL input
without triggering undefined sanitizer
2020-09-15 14:54:53 -07:00
Yann Collet
4f33a5935b added test triggering NULL arithmetic with usan
described in #847
2020-09-15 13:45:06 -07:00
Yann Collet
440c8461d7
Merge pull request #910 from lz4/extraInput
Fix issue #783
2020-08-27 11:00:28 -07:00
Yann Collet
8b75d403d8 fixed minor pre-existing printf formatting
different signedness
2020-08-27 09:20:01 -07:00
Yann Collet
875308f31f fixed strict c90 support 2020-08-27 00:38:58 -07:00
Yann Collet
c5d6f8a8be fix #783
LZ4_decompress_safe_partial()
now also supports a scenario where
nb_bytes_to_generate is <= block_decompressed_size
And
nb_bytes_to_read is >= block_compressed_size.

Previously, the only supported scenario was
nb_bytes_to_read == block_compress_size.

Pay attention that,
if nb_bytes_to_read is > block_compressed_size,
then, necessarily, it requires that
nb_bytes_to_generate is <= block_decompress_size.
If both are larger, it will generate corrupted data.
2020-08-27 00:17:57 -07:00
Yann Collet
3e3a006c6f Merge branch 'dev' into extraInput 2020-08-26 23:20:28 -07:00
Yann Collet
b73cd37bab
Merge pull request #909 from lz4/fasterCount
Improved software byte count
2020-08-26 08:13:52 -07:00
Yann Collet
a7ba363514 Merge branch 'dev' into fasterCount 2020-08-25 22:18:54 -07:00
Yann Collet
5243173b23 added documentation about LZ4_FORCE_SW_BITCOUNT
Also : added memory-frugal software byte count for big endian 64-bit cpus.
Disabled by default.
2020-08-25 22:17:29 -07:00
Yann Collet
fe0bfb0c77
Merge pull request #908 from lz4/stdin_size
Added ability to determine content-size
2020-08-25 21:15:31 -07:00
Yann Collet
5b3f945310 fix test under non-interactive environment 2020-08-25 14:53:08 -07:00
Yann Collet
224735ea1b added more tests around --content-size
notably in association with `stdin`
2020-08-25 14:42:15 -07:00
Yann Collet
65f081ccaf use variables for program invocation 2020-08-25 14:25:51 -07:00
Yann Collet
442005ff8e
Merge pull request #905 from nh2/use-fstat
Use fstat() to determine file size
2020-08-25 14:19:40 -07:00
Niklas Hambüchen
a58b7ac6ce fixup: Portable fileno() 2020-08-25 03:37:41 +02:00
Niklas Hambüchen
86edeb6784 fixup: C90 compliance, clean up stat() types/calls 2020-08-25 03:36:57 +02:00