summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/miekg/dns/fuzz.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/miekg/dns/fuzz.go')
-rw-r--r--vendor/github.com/miekg/dns/fuzz.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/miekg/dns/fuzz.go b/vendor/github.com/miekg/dns/fuzz.go
new file mode 100644
index 000000000..a8a09184d
--- /dev/null
+++ b/vendor/github.com/miekg/dns/fuzz.go
@@ -0,0 +1,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
+}