parser: add basic fuzzing

This commit is contained in:
George Tankersley
2018-11-07 21:01:20 +00:00
parent e91ccd258f
commit f4d5ff96ed
7 changed files with 19 additions and 0 deletions

12
parser/fuzz.go Normal file
View File

@@ -0,0 +1,12 @@
// +build gofuzz
package parser
func Fuzz(data []byte) int {
block := NewBlock()
_, err := block.ParseFromSlice(data)
if err != nil {
return 0
}
return 1
}