VictoriaMetrics/vendor/github.com/valyala/fastjson/fuzz.go
Aliaksandr Valialkin 1c436b2723 vendor: update github.com/valyala/fastjson from v1.4.1 to v1.4.2
This fixes parsing of `inf` and `nan` values in json lines passed to `/api/v1/import`
2020-01-08 20:47:21 +02:00

23 lines
274 B
Go

// +build gofuzz
package fastjson
func Fuzz(data []byte) int {
err := ValidateBytes(data)
if err != nil {
return 0
}
v := MustParseBytes(data)
dst := make([]byte, 0)
dst = v.MarshalTo(dst)
err = ValidateBytes(dst)
if err != nil {
panic(err)
}
return 1
}