mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
1c436b2723
This fixes parsing of `inf` and `nan` values in json lines passed to `/api/v1/import`
22 lines
274 B
Go
22 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
|
|
}
|