Commit d2d01a7
authored
Fix remaining ArrayIndexOutOfBoundsExceptions in LZ4DecompressorTest (#6)
An ArrayIndexOutOfBoundsException could indicate either an out-of-bounds access, or invalid arguments (e.g. offset < 0). Since we want to detect the former in the fuzz tests, we need to make sure the latter doesn't happen. This PR:
- Disables the ArrayIndexOutOfBoundsException catch so that it's reported by the fuzzer
- Fixes a bug in the test where the src length was larger than allowed
- Adjusts the LZ4JNIFastDecompressor to throw an LZ4Exception on empty input rather than an ArrayIndexOutOfBoundsExceptions (made by @Marcono1234; not security relevant, this only changes the exception. LZ4JNIFastDecompressor is also disabled by default due to CVE-2025-12183)
With these changes, a quick fuzz run now only shows the native_fast_* tests failing, both with a segfault, which is expected due to CVE-2025-12183.1 parent 999c401 commit d2d01a7
File tree
2 files changed
+16
-5
lines changed- src
- java/net/jpountz/lz4
- test/net/jpountz/fuzz
2 files changed
+16
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
49 | | - | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments