keksvpn/vendor/github.com/mdlayher/genetlink/fuzz.go

22 lines
306 B
Go
Raw Normal View History

2022-02-27 03:22:11 +00:00
//go:build gofuzz
// +build gofuzz
package genetlink
func Fuzz(data []byte) int {
return fuzzMessage(data)
}
func fuzzMessage(data []byte) int {
var m Message
if err := (&m).UnmarshalBinary(data); err != nil {
return 0
}
if _, err := m.MarshalBinary(); err != nil {
panic(err)
}
return 1
}