mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-18 14:47:03 +00:00
aliases: Fuzz testing
This commit is contained in:
22
internal/aliases/fuzz.go
Normal file
22
internal/aliases/fuzz.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Fuzz testing for package aliases.
|
||||
|
||||
// +build gofuzz
|
||||
|
||||
package aliases
|
||||
|
||||
import "bytes"
|
||||
|
||||
func Fuzz(data []byte) int {
|
||||
interesting := 0
|
||||
aliases, _ := parseReader("domain", bytes.NewReader(data))
|
||||
|
||||
// Mark cases with actual aliases as more interesting.
|
||||
for _, rcpts := range aliases {
|
||||
if len(rcpts) > 0 {
|
||||
interesting = 1
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return interesting
|
||||
}
|
||||
Reference in New Issue
Block a user