prometheusmetricsnode-metricsprocfsprometheus-exportersystem-informationhost-metricssystem-metricsmachine-metrics
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
511 B
34 lines
511 B
//+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
|
|
}
|
|
|