Documentation
¶
Overview ¶
Package fuzzcheck holds the checks the decoding fuzz targets share.
Index ¶
Constants ¶
const ( BytesPerInputByte = 4 << 10 BaseBytes = 16 << 20 )
BytesPerInputByte and BaseBytes bound how much a fuzz target may allocate decoding one input: BaseBytes plus BytesPerInputByte for every input byte. The bound is loose on purpose. A message that decodes into Go structs costs a few hundred bytes per wire byte at worst (an empty nested message is two bytes on the wire and a full struct in memory), so a well-behaved decoder stays far below it; what it catches is a decoder that sizes an allocation from a length or count the input claims, or one whose work grows faster than linearly in the input.
Variables ¶
This section is empty.
Functions ¶
func Allocs ¶
Allocs runs fn and fails the test if it allocates more than the bound for an input of n bytes. fn should do all the decoding of the input, protobuf unmarshal included, since that is where a claimed length or count would size an allocation. TotalAlloc is process-wide, so a concurrent allocation elsewhere counts too; the base allowance absorbs that.
func JournalEvents ¶
JournalEvents returns the stored event blobs of every checked-in journal fixture (sqlitelog/testdata/*.db): real records written by released, unreleased and current writers, which makes them the seed corpus for every target that decodes an Event.
Types ¶
This section is empty.