From dc56e24f7f1d3ffc72e8b5a0039c6137b43e89d4 Mon Sep 17 00:00:00 2001 From: randy408 Date: Mon, 14 Oct 2019 17:12:13 +0200 Subject: [PATCH] add build script --- fuzzing/ossfuzz.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 fuzzing/ossfuzz.sh diff --git a/fuzzing/ossfuzz.sh b/fuzzing/ossfuzz.sh new file mode 100644 index 0000000..8de60e4 --- /dev/null +++ b/fuzzing/ossfuzz.sh @@ -0,0 +1,19 @@ +#!/bin/bash -eu + +# This script is meant to be run by +# https://github.com/google/oss-fuzz/blob/master/projects/cjson/Dockerfile + +mkdir build +cd build +cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_CJSON_TEST=OFF .. +make -j$(nproc) + +$CXX $CXXFLAGS -std=c++11 -I. \ + $SRC/cjson/fuzzing/cjson_read_fuzzer.cc \ + -o $OUT/cjson_read_fuzzer \ + $LIB_FUZZING_ENGINE $SRC/cjson/build/libcjson.a + +find $SRC/cjson/fuzzing/inputs -name "*" | \ + xargs zip $OUT/cjson_read_fuzzer_seed_corpus.zip + +cp $SRC/cjson/fuzzing/json.dict $OUT/cjson_read_fuzzer.dict