aboutsummaryrefslogtreecommitdiff
path: root/fuzz/Makefile.am
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-07-11 10:12:08 +0200
committerGitHub <noreply@github.com>2023-07-11 10:12:08 +0200
commit950f5cc4e3ddd9bc0f8881950082283aa381c805 (patch)
tree4686d9c1b1d0348d06db9d6aa8ed166f449e3238 /fuzz/Makefile.am
parent859d9ea3c33c3ed54c159658a94381fdd4e7eccb (diff)
fuzz: extend fuzzing coverage (#2040)
Some notes: * libinjection: according to https://github.com/libinjection/libinjection/issues/44, it seems NULL characters are valid in the input string; * RTP: `rtp_get_stream_type()` is called only for RTP packets; if you want to tell RTP from RTCP you should use `is_rtp_or_rtcp()`; * TLS: unnecessary check; we already make the same check just above, at the beginning of the `while` loop
Diffstat (limited to 'fuzz/Makefile.am')
-rw-r--r--fuzz/Makefile.am17
1 files changed, 16 insertions, 1 deletions
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
index 45efdbb3f..535e76bfc 100644
--- a/fuzz/Makefile.am
+++ b/fuzz/Makefile.am
@@ -2,7 +2,7 @@ bin_PROGRAMS = fuzz_process_packet fuzz_ndpi_reader fuzz_ndpi_reader_alloc_fail
#Alghoritms
bin_PROGRAMS += fuzz_alg_bins fuzz_alg_hll fuzz_alg_hw_rsi_outliers_da fuzz_alg_jitter fuzz_alg_ses_des fuzz_alg_crc32_md5 fuzz_alg_bytestream
#Data structures
-bin_PROGRAMS += fuzz_ds_patricia fuzz_ds_ahocorasick fuzz_ds_libcache fuzz_ds_tree fuzz_ds_ptree
+bin_PROGRAMS += fuzz_ds_patricia fuzz_ds_ahocorasick fuzz_ds_libcache fuzz_ds_tree fuzz_ds_ptree fuzz_ds_hash
#Third party
bin_PROGRAMS += fuzz_libinjection
#Internal crypto
@@ -294,6 +294,21 @@ fuzz_ds_ptree_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
$(fuzz_ds_ptree_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
+fuzz_ds_hash_SOURCES = fuzz_ds_hash.cpp fuzz_common_code.c
+fuzz_ds_hash_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DENABLE_MEM_ALLOC_FAILURES
+fuzz_ds_hash_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS)
+fuzz_ds_hash_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
+fuzz_ds_hash_LDFLAGS = $(LIBS)
+if HAS_FUZZLDFLAGS
+fuzz_ds_hash_CXXFLAGS += $(LIB_FUZZING_ENGINE)
+fuzz_ds_hash_CFLAGS += $(LIB_FUZZING_ENGINE)
+fuzz_ds_hash_LDFLAGS += $(LIB_FUZZING_ENGINE)
+endif
+# force usage of CXX for linker
+fuzz_ds_hash_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
+ $(fuzz_ds_hash_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
+
fuzz_libinjection_SOURCES = fuzz_libinjection.c
fuzz_libinjection_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS)
fuzz_libinjection_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)