hcl/hclsyntax/fuzz/expr/fuzz.go

17 lines
272 B
Go
Raw Normal View History

package fuzzexpr
import (
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
)
func Fuzz(data []byte) int {
_, diags := hclsyntax.ParseExpression(data, "<fuzz-expr>", hcl.Pos{Line: 1, Column: 1})
if diags.HasErrors() {
return 0
}
return 1
}