File: fuzz.go

package info (click to toggle)
golang-github-eapache-go-xerial-snappy 0.0~git20180814.776d571-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 224 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 211 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// +build gofuzz

package snappy

func Fuzz(data []byte) int {
	decode, err := Decode(data)
	if decode == nil && err == nil {
		panic("nil error with nil result")
	}

	if err != nil {
		return 0
	}

	return 1
}