mirror of
https://github.com/MontFerret/ferret.git
synced 2025-01-18 03:22:02 +02:00
Added fuzzer (#501)
* Added fuzzer * Formatting updates * Attempting to fix linter error * Corrected comment
This commit is contained in:
parent
cbb4311b65
commit
311d07ad40
18
pkg/compiler/fuzz/fuzz.go
Normal file
18
pkg/compiler/fuzz/fuzz.go
Normal file
@ -0,0 +1,18 @@
|
||||
package compiler_test
|
||||
|
||||
import (
|
||||
"github.com/MontFerret/ferret/pkg/compiler"
|
||||
)
|
||||
|
||||
// Fuzz is our fuzzer.
|
||||
// The fuzzer is run on oss-fuzz.
|
||||
// Link to the project on oss-fuzz
|
||||
// will be added once the project is up.
|
||||
func Fuzz(data []byte) int {
|
||||
c := compiler.New()
|
||||
p, err := c.Compile(string(data))
|
||||
if err != nil || p == nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user