mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-29 23:49:41 +00:00
The goal of this fuzzer is to test init and deinit of the library, with different configurations. In details: * random memory allocation failures, even during init phase * random `ndpi_init_prefs` parameter of `ndpi_init_detection_module()` * random LRU caches sizes * random bitmask of enabled protocols * random parameters of `ndpi_set_detection_preferences()` * random initialization of opportunistic TLS * random load/don't load of configuration files This new fuzzer is a C++ file, because it uses `FuzzedDataProvider` class (see https://github.com/google/fuzzing/blob/master/docs/split-inputs.md). Note that the (existing) fuzzers need to be linked with C++ compiler anyway, so this new fuzzer doesn't add any new requirements.
24 lines
417 B
C
24 lines
417 B
C
#ifndef __FUZZ_COMMON_CODE_H__
|
|
#define __FUZZ_COMMON_CODE_H__
|
|
|
|
#include "ndpi_api.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#ifdef ENABLE_MEM_ALLOC_FAILURES
|
|
void *malloc_wrapper(size_t size);
|
|
void free_wrapper(void *freeable);
|
|
void set_mem_alloc_state(int value);
|
|
#endif
|
|
|
|
void fuzz_init_detection_module(struct ndpi_detection_module_struct **ndpi_info_mod,
|
|
int enable_log);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|