mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
e8381db778
* Update Kubernetes to v1.21.0 * Update to golang v1.16.2 * Update dependent modules to track with upstream * Switch to upstream flannel * Track changes to upstream cloud-controller-manager and FeatureGates Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
33 lines
536 B
Go
33 lines
536 B
Go
// +build fuzz
|
|
|
|
package dns
|
|
|
|
import "strings"
|
|
|
|
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 {
|
|
str := string(data)
|
|
// Do not fuzz lines that include the $INCLUDE keyword and hint the fuzzer
|
|
// at avoiding them.
|
|
// See GH#1025 for context.
|
|
if strings.Contains(strings.ToUpper(str), "$INCLUDE") {
|
|
return -1
|
|
}
|
|
if _, err := NewRR(str); err != nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
}
|