This commit is contained in:
2026-05-16 00:18:06 -03:00
commit 92941e68a2
66 changed files with 10352 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
//go:build gofuzz
// +build gofuzz
// Fuzzing driver for https://github.com/dvyukov/go-fuzz.
// go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
// $GOPATH/bin/go-fuzz-build
// $GOPATH/bin/go-fuzz
//
// Related link: https://blog.cloudflare.com/dns-parser-meet-go-fuzzer/
package dns
func Fuzz(data []byte) int {
msg, err := MessageFromWireFormat(data)
if err != nil {
return 0
}
_, err = msg.WireFormat()
if err != nil {
panic(err)
}
return 1 // prioritize this input
}