mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-28 03:33:08 +08:00
9fe4437bda
* Use vendored go-swagger * vendor go-swagger * revert un wanteed change * remove un-needed GO111MODULE * Update Makefile Co-Authored-By: techknowlogick <matti@mdranta.net>
32 lines
472 B
Go
Vendored
32 lines
472 B
Go
Vendored
// +build gofuzz
|
|
|
|
package toml
|
|
|
|
func Fuzz(data []byte) int {
|
|
tree, err := LoadBytes(data)
|
|
if err != nil {
|
|
if tree != nil {
|
|
panic("tree must be nil if there is an error")
|
|
}
|
|
return 0
|
|
}
|
|
|
|
str, err := tree.ToTomlString()
|
|
if err != nil {
|
|
if str != "" {
|
|
panic(`str must be "" if there is an error`)
|
|
}
|
|
panic(err)
|
|
}
|
|
|
|
tree, err = Load(str)
|
|
if err != nil {
|
|
if tree != nil {
|
|
panic("tree must be nil if there is an error")
|
|
}
|
|
return 0
|
|
}
|
|
|
|
return 1
|
|
}
|