Documentation ¶
Overview ¶
Package randparam allows a []byte to be used as a source of random parameter values.
The primary use case is to allow fzgo to use dvyukov/go-fuzz to fuzz rich signatures such as:
FuzzFunc(re string, input string, posix bool)
google/gofuzz is used to walk the structure of parameters, but randparam uses custom random generators, including in the hopes of allowing dvyukov/go-fuzz literal injection to work, as well as to better exploit the genetic mutations of dvyukov/go-fuzz, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fuzzer ¶
type Fuzzer struct {
// contains filtered or unexported fields
}
Fuzzer generates random values for public members. It wires together dvyukov/go-fuzz (for randomness, instrumentation, managing corpus, etc.) with google/gofuzz (for walking a structure recursively), though it uses functions from this package to actually fill in string, []byte, and number values.
func NewFuzzer ¶
NewFuzzer returns a *Fuzzer, initialized with the []byte as an input stream for drawing values via rand.Rand.
func (*Fuzzer) Fill ¶
func (f *Fuzzer) Fill(obj interface{})
Fill fills in public members of obj. For numbers, strings, []bytes, it tries to populate the obj value with literals found in the initial input []byte. TODO: decide to call this Fill or Fuzz or something else. We support both Fill and Fuzz for now.