From 953471af8e74b2f0860862a67d28bfd263b9617e Mon Sep 17 00:00:00 2001 From: rsheeter Date: Tue, 3 Jan 2017 17:01:47 -0800 Subject: [PATCH] Use fuzzers provided by woff2 (#242) * add primary contact for woff2 * Use fuzzers provided by woff2 --- projects/woff2/build.sh | 18 +++++------------- projects/woff2/convert_woff2ttf_fuzzer.cc | 17 ----------------- 2 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 projects/woff2/convert_woff2ttf_fuzzer.cc diff --git a/projects/woff2/build.sh b/projects/woff2/build.sh index 77e70c4b1..42f7fc13b 100755 --- a/projects/woff2/build.sh +++ b/projects/woff2/build.sh @@ -21,21 +21,13 @@ cat brotli/shared.mk | sed -e "s/-no-canonical-prefixes//" \ > brotli/shared.mk.temp mv brotli/shared.mk.temp brotli/shared.mk -cat Makefile | sed -e "s/-no-canonical-prefixes//" \ -> Makefile.temp -mv Makefile.temp Makefile - # woff2 uses LFLAGS instead of LDFLAGS. make clean -make -j$(nproc) CC="$CC $CFLAGS" CXX="$CXX $CXXFLAGS" all +make -j$(nproc) CC="$CC $CFLAGS" CXX="$CXX $CXXFLAGS" CANONICAL_PREFIXES= all -# To avoid multiple main() definitions. -rm src/woff2_compress.o src/woff2_decompress.o - -# Build the fuzzer. -fuzzer=convert_woff2ttf_fuzzer -$CXX $CXXFLAGS -std=c++11 -Isrc \ - $SRC/$fuzzer.cc -o $OUT/$fuzzer \ - -lFuzzingEngine src/*.o brotli/dec/*.o brotli/enc/*.o +# Build fuzzers +for fuzzer_archive in $(ls src/*fuzzer*.a); do + $CXX $CXXFLAGS -lFuzzingEngine $fuzzer_archive -o $OUT/${fuzzer_archive%.a} +done cp $SRC/*.options $OUT/ diff --git a/projects/woff2/convert_woff2ttf_fuzzer.cc b/projects/woff2/convert_woff2ttf_fuzzer.cc deleted file mode 100644 index 1c81e32e1..000000000 --- a/projects/woff2/convert_woff2ttf_fuzzer.cc +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include -#include - -#include "woff2_dec.h" - -// Entry point for LibFuzzer. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - std::string buf; - woff2::WOFF2StringOut out(&buf); - out.SetMaxSize(30 * 1024 * 1024); - woff2::ConvertWOFF2ToTTF(data, size, &out); - return 0; -}