Vendor github.com/mdlayher/wifi and dependencies
This commit is contained in:
parent
e9cea11553
commit
82a2b8fc02
34 changed files with 8970 additions and 0 deletions
34
vendor/github.com/mdlayher/netlink/fuzz.go
generated
vendored
Normal file
34
vendor/github.com/mdlayher/netlink/fuzz.go
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
//+build gofuzz
|
||||
|
||||
package netlink
|
||||
|
||||
func Fuzz(data []byte) int {
|
||||
return fuzzAttributes(data)
|
||||
//return fuzzMessage(data)
|
||||
}
|
||||
|
||||
func fuzzAttributes(data []byte) int {
|
||||
attrs, err := UnmarshalAttributes(data)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
if _, err := MarshalAttributes(attrs); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue