Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Set FSE decompress fuzzer max limit #868

Merged
merged 3 commits into from Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/go.yml
Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.20.x
go-version: 1.21.x

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

- name: fse/FuzzCompress
run: go test -run=none -fuzz=FuzzCompress -fuzztime=1000000x -test.fuzzminimizetime=10ms ./fse/.

- name: fse/FuzzDecompress
run: go test -run=none -fuzz=FuzzDecompress -fuzztime=1000000x -test.fuzzminimizetime=10ms ./fse/.
4 changes: 3 additions & 1 deletion fse/fuzz_test.go
Expand Up @@ -32,9 +32,11 @@ func FuzzCompress(f *testing.F) {
}

func FuzzDecompress(f *testing.F) {
fuzz.AddFromZip(f, "testdata/fse_decompress.zip", fuzz.TypeRaw, false)
// Input is mixed, but TypeGoFuzz will fall back to raw input.
fuzz.AddFromZip(f, "testdata/fse_decompress.zip", fuzz.TypeGoFuzz, false)
f.Fuzz(func(t *testing.T, buf0 []byte) {
var s2 Scratch
s2.DecompressLimit = 128 << 10
//Decompress
got, err := Decompress(buf0, &s2)
if err != nil || len(got) == 0 {
Expand Down
Binary file modified fse/testdata/fse_decompress.zip
Binary file not shown.