mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
b79dec8138
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
22 lines
365 B
Go
22 lines
365 B
Go
//go:build gofuzz
|
|
// +build gofuzz
|
|
|
|
// Use with https://github.com/dvyukov/go-fuzz
|
|
|
|
package ebpf
|
|
|
|
import "bytes"
|
|
|
|
func FuzzLoadCollectionSpec(data []byte) int {
|
|
spec, err := LoadCollectionSpecFromReader(bytes.NewReader(data))
|
|
if err != nil {
|
|
if spec != nil {
|
|
panic("spec is not nil")
|
|
}
|
|
return 0
|
|
}
|
|
if spec == nil {
|
|
panic("spec is nil")
|
|
}
|
|
return 1
|
|
}
|