aboutsummaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/Makefile.am4
-rw-r--r--fuzz/fuzz_ndpi_reader.c12
-rw-r--r--fuzz/fuzz_readerutils_parseprotolist.cpp4
-rw-r--r--fuzz/fuzz_readerutils_workflow.cpp4
4 files changed, 3 insertions, 21 deletions
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
index 8353cae49..a0cfc501c 100644
--- a/fuzz/Makefile.am
+++ b/fuzz/Makefile.am
@@ -577,8 +577,8 @@ fuzz_filecfg_config_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(fuzz_filecfg_config_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
fuzz_readerutils_workflow_SOURCES = fuzz_readerutils_workflow.cpp fuzz_common_code.c ../example/reader_util.c
-fuzz_readerutils_workflow_CXXFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS) -DDISABLE_CUSTOM_ALLOCATOR_ON_READERUTILS
-fuzz_readerutils_workflow_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DDISABLE_CUSTOM_ALLOCATOR_ON_READERUTILS
+fuzz_readerutils_workflow_CXXFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS)
+fuzz_readerutils_workflow_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS)
fuzz_readerutils_workflow_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
fuzz_readerutils_workflow_LDFLAGS = $(PCAP_LIB) $(LIBS)
if HAS_FUZZLDFLAGS
diff --git a/fuzz/fuzz_ndpi_reader.c b/fuzz/fuzz_ndpi_reader.c
index 76da3c5ff..7b0268eed 100644
--- a/fuzz/fuzz_ndpi_reader.c
+++ b/fuzz/fuzz_ndpi_reader.c
@@ -11,15 +11,11 @@
struct ndpi_workflow_prefs *prefs = NULL;
struct ndpi_workflow *workflow = NULL;
-u_int32_t current_ndpi_memory = 0, max_ndpi_memory = 0;
u_int8_t enable_payload_analyzer = 0;
u_int8_t enable_flow_stats = 1;
u_int8_t human_readeable_string_len = 5;
u_int8_t max_num_udp_dissected_pkts = 16 /* 8 is enough for most protocols, Signal requires more */, max_num_tcp_dissected_pkts = 80 /* due to telnet */;
-int enable_malloc_bins = 1;
int malloc_size_stats = 0;
-int max_malloc_bins = 14;
-struct ndpi_bin malloc_bins; /* unused */
extern void ndpi_report_payload_stats(FILE *out);
@@ -71,12 +67,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
ndpi_set_config(workflow->ndpi_struct, NULL, "tcp_ack_payload_heuristic", "1");
ndpi_set_config(workflow->ndpi_struct, "tls", "application_blocks_tracking", "1");
- memset(workflow->stats.protocol_counter, 0,
- sizeof(workflow->stats.protocol_counter));
- memset(workflow->stats.protocol_counter_bytes, 0,
- sizeof(workflow->stats.protocol_counter_bytes));
- memset(workflow->stats.protocol_flows, 0,
- sizeof(workflow->stats.protocol_flows));
ndpi_finalize_initialization(workflow->ndpi_struct);
#ifdef CRYPT_FORCE_NO_AESNI
@@ -139,7 +129,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
for(i = 0; i < workflow->prefs.num_roots; i++)
ndpi_tdestroy(workflow->ndpi_flows_root[i], ndpi_flow_info_freer);
ndpi_free(workflow->ndpi_flows_root);
- /* Free payload analyzer data, without printing */
+ /* Free payload analyzer data */
if(enable_payload_analyzer)
ndpi_report_payload_stats(stdout);
diff --git a/fuzz/fuzz_readerutils_parseprotolist.cpp b/fuzz/fuzz_readerutils_parseprotolist.cpp
index f4e7f0485..2a52cef75 100644
--- a/fuzz/fuzz_readerutils_parseprotolist.cpp
+++ b/fuzz/fuzz_readerutils_parseprotolist.cpp
@@ -6,15 +6,11 @@
#include <stdio.h>
#include "fuzzer/FuzzedDataProvider.h"
-u_int32_t current_ndpi_memory = 0, max_ndpi_memory = 0;
u_int8_t enable_payload_analyzer = 0;
u_int8_t enable_flow_stats = 0;
u_int8_t human_readeable_string_len = 5;
u_int8_t max_num_udp_dissected_pkts = 16 /* 8 is enough for most protocols, Signal requires more */, max_num_tcp_dissected_pkts = 80 /* due to telnet */;
-int enable_malloc_bins = 0;
int malloc_size_stats = 0;
-int max_malloc_bins = 14;
-struct ndpi_bin malloc_bins; /* unused */
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
diff --git a/fuzz/fuzz_readerutils_workflow.cpp b/fuzz/fuzz_readerutils_workflow.cpp
index d4d747374..a3aea2e11 100644
--- a/fuzz/fuzz_readerutils_workflow.cpp
+++ b/fuzz/fuzz_readerutils_workflow.cpp
@@ -8,15 +8,11 @@
extern u_int8_t enable_doh_dot_detection;
-u_int32_t current_ndpi_memory = 0, max_ndpi_memory = 0;
u_int8_t enable_payload_analyzer = 0;
u_int8_t enable_flow_stats = 0;
u_int8_t human_readeable_string_len = 5;
u_int8_t max_num_udp_dissected_pkts = 16 /* 8 is enough for most protocols, Signal requires more */, max_num_tcp_dissected_pkts = 80 /* due to telnet */;
-int enable_malloc_bins = 0;
int malloc_size_stats = 0;
-int max_malloc_bins = 14;
-struct ndpi_bin malloc_bins; /* unused */
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
FuzzedDataProvider fuzzed_data(data, size);