added fuzzer for UBJSON input

This commit is contained in:
Niels Lohmann 2018-01-27 18:38:11 +01:00
parent b0a68f540f
commit f0b26c8f38
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
3 changed files with 79 additions and 3 deletions

View file

@ -42,6 +42,7 @@ all:
@echo "fuzz_testing - prepare fuzz testing of the JSON parser"
@echo "fuzz_testing_cbor - prepare fuzz testing of the CBOR parser"
@echo "fuzz_testing_msgpack - prepare fuzz testing of the MessagePack parser"
@echo "fuzz_testing_ubjson - prepare fuzz testing of the UBJSON parser"
@echo "json_unit - create single-file test executable"
@echo "pedantic_clang - run Clang with maximal warning flags"
@echo "pedantic_gcc - run GCC with maximal warning flags"
@ -69,7 +70,6 @@ clean:
rm -fr build_coverage
$(MAKE) clean -Cdoc
$(MAKE) clean -Ctest
$(MAKE) clean -Cbenchmarks
##########################################################################
@ -214,6 +214,14 @@ fuzz_testing_msgpack:
find test/data -size -5k -name *.msgpack | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer"
fuzz_testing_ubjson:
rm -fr fuzz-testing
mkdir -p fuzz-testing fuzz-testing/testcases fuzz-testing/out
$(MAKE) parse_ubjson_fuzzer -C test CXX=afl-clang++
mv test/parse_ubjson_fuzzer fuzz-testing/fuzzer
find test/data -size -5k -name *.ubjson | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer"
fuzzing-start:
afl-fuzz -S fuzzer1 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -S fuzzer2 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &