Documentation ¶
Index ¶
Constants ¶
View Source
const OutOfMemoryPattern = "out of memory"
View Source
const TimedOutPattern = "program hanged"
Variables ¶
View Source
var ( FuzzInteresting = 1 FuzzNormal = 0 FuzzDiscard = -1 )
Fuzz constants for go-fuzz to use when returning from the Fuzz func
Functions ¶
func GetFuncName ¶
Types ¶
type Crasher ¶
Crasher represents a go-fuzz "crasher" (an input that crashed the respective
fuzz function), its corresponding output (panic message), and name (input hash).
func (*Crasher) Recover ¶
func (crasher *Crasher) Recover(recoverCb RecoverCallback)
Recover is intended to be deferred. It calls the recover callback with the
string representation of the recovered value in the event of a panic.
func (*Crasher) Test ¶
func (crasher *Crasher) Test(recoverCb RecoverCallback)
Test calls the crashers fuzz function its input and recovers from panics
with the passed recover callback.
type CrasherIterator ¶
type CrasherIterator struct {
// contains filtered or unexported fields
}
CrasherIterator is an iterator for go-fuzz "crashers" located in the
respective fuzz function's working directory.
func MustNewCrasherIterator ¶
func MustNewCrasherIterator(env *Env, fuzzFunc Func, filters ...IterFilter) *CrasherIterator
MustNewCrasherIterator returns an iterator for crashers but panics if an error occurs.
func NewCrasherIterator ¶
func NewCrasherIterator(env *Env, fuzzFunc Func, filters ...IterFilter) (*CrasherIterator, error)
NewCrasherIteratorFor returns an iterator for crashers that lazily loads their inputs and outputs.
func (CrasherIterator) Filtered ¶
func (iter CrasherIterator) Filtered() int
func (*CrasherIterator) Next ¶
func (iter *CrasherIterator) Next() (next *Crasher, done bool, err error)
Next gets the next crasher and increments the iterator.
func (CrasherIterator) TestFailingLimit ¶
func (iter CrasherIterator) TestFailingLimit(t *testing.T, limit int) (_ *Crasher, panics int, total int)
TestFailingLimit tests each crasher's input against its respective fuzz
function until it sees `limit` failing inputs
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
func (*Env) GetCrasherDir ¶
func (*Env) GetWorkdirs ¶
type IterFilter ¶
func SkipFilter ¶
func SkipFilter(patternStr string, delimiter string, verbose bool) IterFilter
func SkipOutOfMemory ¶
func SkipOutOfMemory(verbose bool) IterFilter
func SkipTimedOut ¶
func SkipTimedOut(verbose bool) IterFilter
type IterFilters ¶
type IterFilters []IterFilter
func (IterFilters) Allows ¶
func (filters IterFilters) Allows(next *Crasher) bool
type RecoverCallback ¶
type RecoverCallback func(panicMsg string)
Click to show internal directories.
Click to hide internal directories.