mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-05 10:02:47 +00:00
8696a8cdf0
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.50 to 1.1.51. - [Release notes](https://github.com/miekg/dns/releases) - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](https://github.com/miekg/dns/compare/v1.1.50...v1.1.51) --- updated-dependencies: - dependency-name: github.com/miekg/dns dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
34 lines
552 B
Go
34 lines
552 B
Go
//go:build fuzz
|
|
// +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
|
|
}
|