Commit Graph

2652 Commits

Author SHA1 Message Date
Yann Collet
c2c0c47d5f fix NULL ptr arithmetic of lz4:1572
was blindly adding an offset (0) to `dictionary` which could be `NULL`.
2021-05-27 23:20:28 -07:00
Yann Collet
8e46846287 fix UB of lz4frame:907
now line 912
by ensuring pointer arithmetic is only performed
if there is a reason for an internal buffer to be used.
2021-05-27 22:59:22 -07:00
Yann Collet
5b86e4e5ed
Merge pull request #982 from t-mat/fix-make-usan
Fix 'make usan'
2021-05-27 10:24:41 -07:00
Yann Collet
d00319baab
Merge pull request #984 from t-mat/fix-wconversion-warning
Fix -Wshorten-64-to-32 warning
2021-05-27 10:13:24 -07:00
Takayuki Matsuoka
0276f0b120 Add GitHub Actions script ci.yml 2021-05-27 21:18:58 +09:00
Takayuki Matsuoka
4a9bbc2480 Fix -Wshorten-64-to-32 warning 2021-05-27 21:12:39 +09:00
Takayuki Matsuoka
0d2570b7c5 Add CC propagation to 'make usan'
The following command doesn't work as intended

```
cd
git clone https://github.com/lz4/lz4.git
cd lz4
make usan MOREFLAGS='-Wcomma -Werror'
```

```
Cleaning completed
cc: error: unrecognized command line option ‘-Wcomma’; did you mean ‘-Wcomment’?
make[3]: *** [<builtin>: ../lib/lz4.o] Error 1
make[2]: *** [Makefile:65: lz4] Error 2
make[1]: *** [Makefile:133: test] Error 2
make: *** [Makefile:158: usan] Error 2
```

Because the following part of the `Makefile` doesn't propagate `CC`, `CFLAGS` and `LDFLAGS` to child `$(MAKE)` properly.

```
.PHONY: usan
usan: CC      = clang
usan: CFLAGS  = -O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow
usan: LDFLAGS = $(CFLAGS)
usan: clean
        $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
```

We need explicit propagation for child process

```
-       $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
+       CC=$(CC) CFLAGS=$(CFLAGS) LDFLAGS=$(LDFLAGS) $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
```

After that, `make usan` works and it shows expected runtime error.

```
$ make usan MOREFLAGS='-Wcomma -Werror'
Cleaning completed

../lib/lz4frame.c:907:25: runtime error: applying non-zero offset 65536 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../lib/lz4frame.c:907:25 in
../lib/lz4frame.c:907:58: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../lib/lz4frame.c:907:58 in

...
```

Please note that `make usan` is working at travis-ci.  Because `.travis.yml` has the following [explicit `compiler:` setting](7a966c1511/.travis.yml (L66)).

```
    - name: (Trusty) USan test
      dist: trusty
      compiler: clang
      script:
        - make usan MOREFLAGS=-Wcomma -Werror
```
2021-05-27 21:02:34 +09:00
Sandy Harvie
7da3ab4bec bump CMake minimum required version to 2.8.12 2021-05-20 19:37:31 +00:00
Yann Collet
7a966c1511
Merge pull request #972 from jasperla/memmove_crash
Fix potential memory corruption with negative memmove() size
2021-04-30 08:56:25 -07:00
Yann Collet
7d8d1075e6 fixed incorrect propagation of default CFLAGS 2021-04-26 22:40:40 -07:00
Yann Collet
bdc9d3b0c1
Merge pull request #973 from klebertarcisio/patch_fix
Avoiding null pointer dereference
2021-03-10 09:56:06 -08:00
klebertosantos
29a6a1f494 fix null pointer dereference 2021-03-10 09:37:57 -03:00
Jasper Lievisse Adriaanse
8301a21773 Fix potential memory corruption with negative memmove() size 2021-02-26 15:21:20 +01:00
Yann Collet
1d58f77818
Merge pull request #970 from Nimloth/patch-1
Update .cirrus.yml
2021-02-19 07:29:07 -08:00
Nimloth
5e433066f8
Update .cirrus.yml
current up-to-date stable branch is 12.2
2021-02-19 08:29:56 +01:00
Yann Collet
a8e888774a
Merge pull request #964 from sigiesec/fix-ubsan-resetStreamHC_fast
Don't trigger UBSan warning in LZ4_resetStreamHC_fast if LZ4_streamHC…
2021-01-19 02:54:18 -08:00
Yann Collet
cbd186eace
Merge pull request #966 from dosaboy/snap-build-1.9.3
Update snapcraft.yaml to reflect latest build
2021-01-07 14:32:38 -08:00
Edward Hope-Morley
c667bbcaf9 Update snapcraft.yaml to reflect latest build 2021-01-07 21:39:00 +00:00
Yann Collet
1930488135
Merge pull request #965 from ThomasWaldmann/fix-typos
fix some typos (work by Andrea Gelmini)
2021-01-07 09:43:11 -08:00
Thomas Waldmann
909aae8260 fix some typos (work by Andrea Gelmini) 2021-01-07 18:39:57 +01:00
Simon Giesecke
06b07e175e Don't trigger UBSan warning in LZ4_resetStreamHC_fast if LZ4_streamHCPtr->internal_donotuse.end is NULL. 2021-01-07 10:21:48 +01:00
Yann Collet
023bb62c8d
Merge pull request #962 from hmaarrfk/patch-1
Add include locations for x64 builds as well
2021-01-05 10:08:39 -08:00
Mark Harfouche
d0b7d802d7
Add include locations for x64 builds as well 2020-12-28 09:06:40 -05:00
Yann Collet
384eb15835
Merge pull request #960 from lz4/Makefile_export
Makefile correctly export CFLAGS
2020-12-17 10:17:47 -08:00
Yann Collet
28ff53b868 fix minor pedantic warnings
initialization and conversion
2020-12-01 08:11:35 -08:00
Yann Collet
4b7a327068 fix strange printf formatting warning
so now, `%p` _requires_ a `void*` pointer ?
2020-12-01 08:05:19 -08:00
Yann Collet
50ff8b3ae8 fix minor header date 2020-11-30 18:16:00 -08:00
Yann Collet
16bad2caaf fix scanbuild test
seems to require explicit environment variables
2020-11-30 18:13:05 -08:00
Yann Collet
19564bce78 fix CFLAGS unexport issue 2020-11-30 17:42:36 -08:00
Yann Collet
5a551754cf Merge branch 'dev' into Makefile
remove `LN_S`
2020-11-30 16:09:22 -08:00
Yann Collet
07a2476fe6
Merge pull request #959 from lz4/install_ln
install links over existing install
2020-11-30 16:07:44 -08:00
Yann Collet
e585a438c7 refactor Makefile
remove usage of include Makefile.inc in too Makefile
as it seems to somehow unexport CFLAGS ...
2020-11-30 16:06:50 -08:00
Yann Collet
165fdddc28 install links over existing install
ensures links are created
2020-11-30 05:13:38 -08:00
Yann Collet
87a80acbe7 updated license & header dates 2020-11-25 14:45:14 -08:00
Yann Collet
51976dcb24 ignore test artifacts starting with tmp* 2020-11-25 12:09:06 -08:00
Yann Collet
db6edc43f7
Merge pull request #955 from aqrit/dev
Remove accidentally committed temporary files
2020-11-17 15:26:47 -08:00
aqrit
f5aa98574f
Delete tmpsparse 2020-11-17 17:57:53 -05:00
aqrit
e6ee895204
Delete tmp 2020-11-17 17:53:28 -05:00
Yann Collet
9cf52b3151 minor formatting title 2020-11-16 01:52:42 -08:00
Yann Collet
48d9b7416b update cli entry 2020-11-15 19:46:12 -08:00
Yann Collet
0760724577 update doc 2020-11-15 01:31:09 -08:00
Yann Collet
0bd7dafc93
Merge pull request #953 from lz4/vs2005
better MSVC conformance
2020-11-15 01:23:40 -08:00
Yann Collet
f61b034cd7 fix minor win32 warning 2020-11-14 20:39:23 -08:00
Yann Collet
99ba44a596 fixed minor Visual warning
doesn't happen on my environment, though it's a different version of Visual Studio
2020-11-14 17:25:31 -08:00
Yann Collet
c1c3d04f1c
Merge pull request #952 from lz4/lz4io
Fix --sparse mode
2020-11-14 16:49:43 -08:00
Yann Collet
e0f85f2fc8 better visual conformance
only include <intrin.h> on vs2005+ (#947)
remove some useless #pragma
fix a few minor Visual warnings
2020-11-14 16:27:57 -08:00
Yann Collet
468011c346 Merge branch 'dev' of github.com:Cyan4973/lz4 into dev 2020-11-14 14:26:48 -08:00
Yann Collet
581c459b4e restrict BitScanForward() to VS2005+
suggested by @aqrit in #947
2020-11-14 14:26:08 -08:00
Yann Collet
be13653ad0 fix minor parse warning 2020-11-14 12:44:18 -08:00
Yann Collet
36eadb205a all usages of prefs within lz4io are const 2020-11-14 12:40:17 -08:00