- pool.go: add missing Arena.Reset() call inside ArenaPool.Put() - Treat nil values as null in SetArrayItem prevents a potential panic when a nil value is used as an array item full diff: https://github.com/valyala/fastjson/compare/v1.6.4...v1.6.7 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
24 lines
292 B
Go
24 lines
292 B
Go
//go:build gofuzz
|
|
// +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
|
|
}
|