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"
#include "fuzz_third_party_seq_prod.h"

Macros

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

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)))

◆ SPLITMARK

#define SPLITMARK   5234

◆ SPLITPROB

#define SPLITPROB   6000

◆ ZSTD_FUZZ_GENERATED_DICT_MAXSIZE

#define ZSTD_FUZZ_GENERATED_DICT_MAXSIZE   (1 << ZSTD_WINDOWLOG_MAX_32) /* Allow up to 1 << ZSTD_WINDOWLOG_MAX_32 dictionary */

◆ ZSTD_FUZZ_GENERATED_LITERALS_SIZE

#define ZSTD_FUZZ_GENERATED_LITERALS_SIZE   (1 << 20) /* Fixed size 1MB 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.

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.