Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
sequence_compression_api.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "fuzz_helpers.h"
#include "zstd_helpers.h"
#include "fuzz_data_producer.h"

Macros

#define ZSTD_STATIC_LINKING_ONLY
 
#define ZSTD_FUZZ_GENERATED_SRC_MAXSIZE   (1 << 20) /* Allow up to 1MB generated data */
 
#define ZSTD_FUZZ_MATCHLENGTH_MAXSIZE   (1 << 18) /* Allow up to 256KB matches */
 
#define ZSTD_FUZZ_GENERATED_DICT_MAXSIZE   (1 << 18) /* Allow up to a 256KB dict */
 
#define ZSTD_FUZZ_GENERATED_LITERALS_SIZE   (1 << 18) /* Fixed size 256KB literals buffer */
 
#define ZSTD_FUZZ_MAX_NBSEQ   (1 << 17) /* Maximum of 128K sequences */
 
#define FUZZ_RDG_rotl32(x, r)
 

Functions

int LLVMFuzzerTestOneInput (const uint8_t *src, size_t size)
 

Macro Definition Documentation

◆ FUZZ_RDG_rotl32

#define FUZZ_RDG_rotl32 ( x,
r )
Value:
((x << r) | (x >> (32 - r)))

◆ ZSTD_FUZZ_GENERATED_DICT_MAXSIZE

#define ZSTD_FUZZ_GENERATED_DICT_MAXSIZE   (1 << 18) /* Allow up to a 256KB dict */

◆ ZSTD_FUZZ_GENERATED_LITERALS_SIZE

#define ZSTD_FUZZ_GENERATED_LITERALS_SIZE   (1 << 18) /* Fixed size 256KB literals buffer */

◆ ZSTD_FUZZ_GENERATED_SRC_MAXSIZE

#define ZSTD_FUZZ_GENERATED_SRC_MAXSIZE   (1 << 20) /* Allow up to 1MB generated data */

◆ ZSTD_FUZZ_MATCHLENGTH_MAXSIZE

#define ZSTD_FUZZ_MATCHLENGTH_MAXSIZE   (1 << 18) /* Allow up to 256KB matches */

◆ ZSTD_FUZZ_MAX_NBSEQ

#define ZSTD_FUZZ_MAX_NBSEQ   (1 << 17) /* Maximum of 128K sequences */

◆ ZSTD_STATIC_LINKING_ONLY

#define ZSTD_STATIC_LINKING_ONLY

This fuzz target performs a zstd round-trip test by generating an arbitrary array of sequences, generating the associated source buffer, calling ZSTD_compressSequences(), and then decompresses and compares the result with the original generated source buffer.

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.