Skip to content

Commit 2d59657

Browse files
authored
test: Set FSE decompress fuzzer max limit (#868)
* test: Set FSE decompress fuzzer max limit Avoids timeout on large output. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63059 * Add to CI & Add more baseline
1 parent 0e1030c commit 2d59657

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.github/workflows/go.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
- name: Set up Go
148148
uses: actions/setup-go@v2
149149
with:
150-
go-version: 1.20.x
150+
go-version: 1.21.x
151151

152152
- name: Checkout code
153153
uses: actions/checkout@v2
@@ -201,3 +201,8 @@ jobs:
201201
- name: zip/FuzzReader
202202
run: go test -run=none -fuzz=FuzzReader -fuzztime=500000x -test.fuzzminimizetime=10ms ./zip/.
203203

204+
- name: fse/FuzzCompress
205+
run: go test -run=none -fuzz=FuzzCompress -fuzztime=1000000x -test.fuzzminimizetime=10ms ./fse/.
206+
207+
- name: fse/FuzzDecompress
208+
run: go test -run=none -fuzz=FuzzDecompress -fuzztime=1000000x -test.fuzzminimizetime=10ms ./fse/.

fse/fuzz_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ func FuzzCompress(f *testing.F) {
3232
}
3333

3434
func FuzzDecompress(f *testing.F) {
35-
fuzz.AddFromZip(f, "testdata/fse_decompress.zip", fuzz.TypeRaw, false)
35+
// Input is mixed, but TypeGoFuzz will fall back to raw input.
36+
fuzz.AddFromZip(f, "testdata/fse_decompress.zip", fuzz.TypeGoFuzz, false)
3637
f.Fuzz(func(t *testing.T, buf0 []byte) {
3738
var s2 Scratch
39+
s2.DecompressLimit = 128 << 10
3840
//Decompress
3941
got, err := Decompress(buf0, &s2)
4042
if err != nil || len(got) == 0 {

fse/testdata/fse_decompress.zip

20.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)