summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/miekg/dns/fuzz.go
blob: a8a09184d4049a1487b5753103065c5fe98bfa7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// +build fuzz

package dns

func Fuzz(data []byte) int {
	msg := new(Msg)

	if err := msg.Unpack(data); err != nil {
		return 0
	}
	if _, err := msg.Pack(); err != nil {
		return 0
	}

	return 1
}

func FuzzNewRR(data []byte) int {
	if _, err := NewRR(string(data)); err != nil {
		return 0
	}
	return 1
}