dgryski.semgrep-go.gofuzz.go-fuzz-to-native-fuzzing

Author
unknown
Download Count*
License
old-style go-fuzz fuzz function found
Run Locally
Run in CI
Defintion
rules:
- id: go-fuzz-to-native-fuzzing
patterns:
- pattern: func Fuzz($DATA []byte) int { $...BODY }
fix: |
// remove gofuzz build tag
// rename file to _test.go
// convert corpus with file2fuzz
func FuzzData(f *testing.F) {
f.Fuzz(func(t *testing.T, $DATA []byte) {
func() int {
$...BODY
}()
})
}
message: old-style go-fuzz fuzz function found
languages:
- go
severity: ERROR
metadata:
license: MIT
Short Link: https://sg.run/pD3e