mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
56481e899d
full diff: 1c8d4c9ef7
...v0.5.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
21 lines
347 B
Go
21 lines
347 B
Go
// +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
|
|
}
|