Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
fuzz.h File Reference
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define FUZZ_RNG_SEED_SIZE   4
 

Functions

int LLVMFuzzerTestOneInput (const uint8_t *src, size_t size)
 

Macro Definition Documentation

◆ FUZZ_RNG_SEED_SIZE

#define FUZZ_RNG_SEED_SIZE   4

Fuzz target interface. Fuzz targets have some common parameters passed as macros during compilation. Check the documentation for each individual fuzzer for more parameters.

Parameters
FUZZ_RNG_SEED_SIZEThe number of bytes of the source to look at when constructing a seed for the deterministic RNG. These bytes are discarded before passing the data to lz4 functions. Every fuzzer initializes the RNG exactly once before doing anything else, even if it is unused. Default: 4.
LZ4_DEBUGThis is a parameter for the lz4 library. Defining LZ4_DEBUG=1 enables assert() statements in the lz4 library. Higher levels enable logging, so aren't recommended. Defining LZ4_DEBUG=1 is recommended.
LZ4_FORCE_MEMORY_ACCESSThis flag controls how the zstd library accesses unaligned memory. It can be undefined, or 0 through 2. If it is undefined, it selects the method to use based on the compiler. If testing with UBSAN set MEM_FORCE_MEMORY_ACCESS=0 to use the standard compliant method.
FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTIONThis is the canonical flag to enable deterministic builds for fuzzing. Changes to zstd for fuzzing are gated behind this define. It is recommended to define this when building zstd for fuzzing.

Function Documentation

◆ LLVMFuzzerTestOneInput()

int LLVMFuzzerTestOneInput ( const uint8_t * src,
size_t size )

This fuzz target attempts to compress the fuzzed data with the simple compression function with an output buffer that may be too small to ensure that the compressor never crashes.

This fuzz target attempts to decompress the fuzzed data with the simple decompression function to ensure the decompressor never crashes.

This fuzz target performs a lz4 round-trip test (compress & decompress), compares the result with the original, and calls abort() on corruption.

This fuzz target fuzzes all of the helper functions that consume compressed input.

This fuzz target performs a zstd round-trip test (compress & decompress), compares the result with the original, and calls abort() on corruption.