Files
tidb/types/fuzzMarshalJSON.go
AdamKorcz c928a53cd2 types: Introduce fuzzing by adding 3 fuzzers (#17250)
* Added 3 fuzzers


Co-authored-by: pingcap-github-bot <sre-bot@pingcap.com>
2020-05-19 20:29:39 +08:00

17 lines
296 B
Go

package types
import "github.com/pingcap/tidb/types/json"
// FuzzMarshalJSON implements the fuzzer
func FuzzMarshalJSON(data []byte) int {
bj, err := json.ParseBinaryFromString(string(data))
if err != nil {
return -1
}
_, err = bj.MarshalJSON()
if err != nil {
return 0
}
return 1
}