Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cJSON/blob/master/fuzzing/CMakeLists.txt # cJSON [Ported from github.com/DaveGamble/cJSON] Fix: heap-use-after-free in merge_patch when patch is subtree of target (#1065) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `cJSON / fuzzing / CMakeLists.txt` 34 lines ยท 1169 bytes Raw Blame History 1 option(ENABLE_FUZZING "Create executables and targets for fuzzing cJSON with afl." Off) 2 if (ENABLE_FUZZING) 3 find_program(AFL_FUZZ afl-fuzz) 4 if ("${AFL_FUZZ}" MATCHES "AFL_FUZZ-NOTFOUND") 5 message(FATAL_ERROR "Couldn't find afl-fuzz.") 6 endif() 7 8 add_executable(afl-main afl.c) 9 target_link_libraries(afl-main "${CJSON_LIB}") 10 11 if (NOT ENABLE_SANITIZERS) 12 message(FATAL_ERROR "Enable sanitizers with -DENABLE_SANITIZERS=On to do fuzzing.") 13 endif() 14 15 option(ENABLE_FUZZING_PRINT "Fuzz printing functions together with parser." On) 16 set(fuzz_print_parameter "no") 17 if (ENABLE_FUZZING_PRINT) 18 set(fuzz_print_parameter "yes") 19 endif() 20 21 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error") 22 23 add_custom_target(afl 24 COMMAND "${AFL_FUZZ}" -i "${CMAKE_CURRENT_SOURCE_DIR}/inputs" -o "${CMAKE_CURRENT_BINARY_DIR}/findings" -x "${CMAKE_CURRENT_SOURCE_DIR}/json.dict" -- "${CMAKE_CURRENT_BINARY_DIR}/afl-main" "@@" "${fuzz_print_parameter}" 25 DEPENDS afl-main) 26 27 28 endif() 29 30 if(ENABLE_CJSON_TEST) 31 ADD_EXECUTABLE(fuzz_main fuzz_main.c cjson_read_fuzzer.c) 32 TARGET_LINK_LIBRARIES(fuzz_main cjson) 33 endif() 34