mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
fuzz: revert setup function (#3189)
This can't be used in its current form; revert the entire PR.
Revert "fuzzing: allow setup function to be called (#3175)"
This reverts commit 62451fd3eb.
This commit is contained in:
@@ -11,12 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// Do will fuzz p - used by gofuzz. See Makefile.fuzz for comments and context.
|
||||
func Do(p plugin.Handler, fn SetupFunc, data []byte) int {
|
||||
if fn != nil {
|
||||
if err := fn(); err != nil {
|
||||
panic("fuzz: " + err.Error())
|
||||
}
|
||||
}
|
||||
func Do(p plugin.Handler, data []byte) int {
|
||||
ctx := context.TODO()
|
||||
r := new(dns.Msg)
|
||||
if err := r.Unpack(data); err != nil {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package fuzz
|
||||
|
||||
// SetupFunc can be given to Do to perform a one time setup of the fuzzing
|
||||
// environment. This function is called on every fuzz, it is your
|
||||
// responsibility to make it idempotent. If SetupFunc returns an error, panic
|
||||
// is called with that error.
|
||||
//
|
||||
// There isn't a ShutdownFunc, because fuzzing is supposed to be run for a long
|
||||
// time and there isn't any hook to call it from.
|
||||
type SetupFunc func() error
|
||||
Reference in New Issue
Block a user