From de864b54bf291dbb09ca6833803e18f56aeaea6e Mon Sep 17 00:00:00 2001 From: Randy <33860634+randy408@users.noreply.github.com> Date: Mon, 28 Jan 2019 18:23:20 +0200 Subject: [PATCH] [libspng] add structure aware fuzzer (#2117) --- projects/libspng/Dockerfile | 1 + projects/libspng/build.sh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/projects/libspng/Dockerfile b/projects/libspng/Dockerfile index 55c4c2edb..ee5f14e3f 100644 --- a/projects/libspng/Dockerfile +++ b/projects/libspng/Dockerfile @@ -23,6 +23,7 @@ RUN apt-get update && \ apt-get install -y pkg-config zlib1g-dev RUN git clone --depth 1 https://gitlab.com/randy408/libspng.git +RUN git clone --depth 1 https://github.com/google/fuzzer-test-suite WORKDIR libspng COPY build.sh $SRC/ diff --git a/projects/libspng/build.sh b/projects/libspng/build.sh index 62223bbd0..f08577340 100644 --- a/projects/libspng/build.sh +++ b/projects/libspng/build.sh @@ -24,6 +24,13 @@ $CXX $CXXFLAGS -std=c++11 -I. \ -o $OUT/spng_read_fuzzer \ -lFuzzingEngine $SRC/libspng/build/libspng.a -lz +$CXX $CXXFLAGS -std=c++11 -I. \ + $SRC/libspng/tests/spng_read_fuzzer.cc \ + -o $OUT/spng_read_fuzzer_structure_aware \ + -include ../fuzzer-test-suite/libpng-1.2.56/png_mutator.h \ + -D PNG_MUTATOR_DEFINE_LIBFUZZER_CUSTOM_MUTATOR \ + -lFuzzingEngine $SRC/libspng/build/libspng.a -lz + find $SRC/libspng/tests/images -name "*.png" | \ xargs zip $OUT/spng_read_fuzzer_seed_corpus.zip