File: fuzz.go

package info (click to toggle)
golang-github-streadway-amqp 0.0~git20150820.0.f4879ba-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 480 kB
  • ctags: 819
  • sloc: xml: 495; sh: 126; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 237 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// +build gofuzz
package amqp

import "bytes"

func Fuzz(data []byte) int {
	r := reader{bytes.NewReader(data)}
	frame, err := r.ReadFrame()
	if err != nil {
		if frame != nil {
			panic("frame is not nil")
		}
		return 0
	}
	return 1
}