fuzzing

package
v0.0.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 GetCrashersDir

func GetCrashersDir(name string) string

func GetWorkdir

func GetWorkdir(name string) string

Types

type Crasher

type Crasher struct {
	Name     string
	Input    []byte
	Output   string
	FuzzFunc FuzzFunc
}

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(fuzzFunc FuzzFunc) *CrasherIterator

MustNewCrasherIterator returns an iterator for crashers but panics if an error occurs.

func NewCrasherItertor

func NewCrasherItertor(fuzzFunc FuzzFunc) (*CrasherIterator, error)

NewCrasherIteratorFor returns an iterator for crashers that lazily loads their inputs and outputs.

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 FuzzFunc

type FuzzFunc func([]byte) int

type RecoverCallback

type RecoverCallback func(panicMsg string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL