mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
mox!
This commit is contained in:
25
dkim/fuzz_test.go
Normal file
25
dkim/fuzz_test.go
Normal file
@ -0,0 +1,25 @@
|
||||
package dkim
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func FuzzParseSignature(f *testing.F) {
|
||||
f.Add([]byte(""))
|
||||
f.Fuzz(func(t *testing.T, buf []byte) {
|
||||
parseSignature(buf, false)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzParseRecord(f *testing.F) {
|
||||
f.Add("")
|
||||
f.Add("v=DKIM1; p=bad")
|
||||
f.Fuzz(func(t *testing.T, s string) {
|
||||
r, _, err := ParseRecord(s)
|
||||
if err == nil {
|
||||
if _, err := r.Record(); err != nil {
|
||||
t.Errorf("r.Record() for parsed record %s, %#v: %s", s, r, err)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user