diff options
author | Toni <matzeton@googlemail.com> | 2021-10-18 23:16:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-18 23:16:32 +0200 |
commit | ed51987e3a4838dd9aef27dfab2c0651f2f52836 (patch) | |
tree | fde07d774b7ef89b3d4b400f0c2af3f07f4f70ce /fuzz/Makefile.am | |
parent | 7d3c3b23f8b9749690b8c5f345b7bc489b3666ac (diff) |
Fix broken fuzz_process_packet fuzzer by adding a call to ndpi_finalize_initialization(). (#1334)
* fixed several memory errors (heap-overflow, unitialized memory, etc)
* ability to build fuzz_process_packet with a main()
allowing to replay crash data generated with fuzz_process_packet
by LLVMs libfuzzer
* temporarily disable fuzzing if `tests/do.sh`
executed with env FUZZY_TESTING_ENABLED=1
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'fuzz/Makefile.am')
-rw-r--r-- | fuzz/Makefile.am | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 7858c3371..ade21ac5a 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -1,4 +1,4 @@ -bin_PROGRAMS = fuzz_process_packet fuzz_ndpi_reader fuzz_ndpi_reader_with_main +bin_PROGRAMS = fuzz_process_packet fuzz_process_packet_with_main fuzz_ndpi_reader fuzz_ndpi_reader_with_main fuzz_process_packet_SOURCES = fuzz_process_packet.c fuzz_process_packet_CFLAGS = @@ -13,6 +13,15 @@ fuzz_process_packet_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(fuzz_process_packet_LDFLAGS) $(LDFLAGS) -o $@ +fuzz_process_packet_with_main_SOURCES = fuzz_process_packet.c +fuzz_process_packet_with_main_CFLAGS = -DBUILD_MAIN +fuzz_process_packet_with_main_LDADD = ../src/lib/libndpi.a +fuzz_process_packet_with_main_LDFLAGS = $(ADDITIONAL_LIBS) $(LIBS) +# force usage of CXX for linker +fuzz_process_packet_with_main_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(fuzz_process_packet_with_main_LDFLAGS) $(LDFLAGS) -o $@ + fuzz_ndpi_reader_SOURCES = fuzz_ndpi_reader.c fuzz_ndpi_reader_CFLAGS = -I../example/ fuzz_ndpi_reader_LDADD = ../example/libndpiReader.a ../src/lib/libndpi.a |