diff --git a/projects/example/my-api-repo/Makefile b/projects/example/my-api-repo/Makefile index 380d3a904..5126b0cb8 100644 --- a/projects/example/my-api-repo/Makefile +++ b/projects/example/my-api-repo/Makefile @@ -24,11 +24,11 @@ LIB_FUZZING_ENGINE ?= standalone_fuzz_target_runner.o # You may add extra compiler flags like this: CXXFLAGS += -std=c++11 +all: do_stuff_unittest do_stuff_fuzzer + clean: rm -fv *.a *.o *unittest *_fuzzer *_seed_corpus.zip crash-* *.zip -all: do_stuff_unittest do_stuff_fuzzer - # Continuos integration system should run "make clean && make check" check: all ./do_stuff_unittest @@ -40,7 +40,7 @@ do_stuff_unittest: do_stuff_unittest.cpp my_api.a # Fuzz target, links against $LIB_FUZZING_ENGINE, so that # you may choose which fuzzing engine to use. -do_stuff_fuzzer: do_stuff_fuzzer.cpp my_api.a standalone_fuzz_target_runner.o +do_stuff_fuzzer: do_stuff_fuzzer.cpp my_api.a ${LIB_FUZZING_ENGINE} ${CXX} ${CXXFLAGS} $< my_api.a ${LIB_FUZZING_ENGINE} -o $@ zip -q -r do_stuff_fuzzer_seed_corpus.zip do_stuff_test_data diff --git a/projects/example/my-api-repo/README.md b/projects/example/my-api-repo/README.md index d9c4b8fb6..748f87e89 100644 --- a/projects/example/my-api-repo/README.md +++ b/projects/example/my-api-repo/README.md @@ -6,7 +6,7 @@ This directory contains an example software project that has most of the traits Imagine that these files reside in your project's repository: * [my_api.h](my_api.h): and [my_api.cpp](my_api.cpp) implement the API we want to test/fuzz. The function `DoStuff()` inside [my_api.cpp](my_api.cpp) contains a bug. (Find it!) -* [do_stuff_unittest.cpp](do_stuff_unittest.cpp): is a unit test for `DoStuff()`. Unit tests are not necessary for fuzzing, but are generally a good practice. +* [do_stuff_unittest.cpp](do_stuff_unittest.cpp): is a unit test for `DoStuff()`. Unit tests are not necessary for fuzzing but are generally a good practice. * [do_stuff_fuzzer.cpp](do_stuff_fuzzer.cpp): is a [fuzz target](http://libfuzzer.info/#fuzz-target) for `DoStuff()`. * [do_stuff_test_data](do_stuff_test_data): corpus directory for [do_stuff_fuzzer.cpp](do_stuff_fuzzer.cpp). * [do_stuff_fuzzer.dict](do_stuff_fuzzer.dict): a [fuzzing dictionary file](https://github.com/google/oss-fuzz/blob/master/docs/new_project_guide.md#dictionaries) for `DoStuff()`. Optional, but may improve fuzzing in many cases. @@ -15,12 +15,12 @@ Imagine that these files reside in your project's repository: * accepts external fuzzing engine via `$LIB_FUZZING_ENGINE`, by default uses [standalone_fuzz_target_runner.cpp](standalone_fuzz_target_runner.cpp) * builds the fuzz target(s) and their corpus archive(s) * `make check` executes [do_stuff_fuzzer.cpp](do_stuff_fuzzer.cpp) on [`do_stuff_test_data/*`](do_stuff_test_data), thus ensures that the fuzz target is up to date and uses it as a regression test. -* [standalone_fuzz_target_runner.cpp](standalone_fuzz_target_runner.cpp): is a simple standalone runnner for fuzz targets. You may use it to execute a fuzz target on given files w/o having to link in libFuzzer or other fuzzing engine. +* [standalone_fuzz_target_runner.cpp](standalone_fuzz_target_runner.cpp): is a simple standalone runner for fuzz targets. You may use it to execute a fuzz target on given files w/o having to link in libFuzzer or other fuzzing engine. ## Files in OSS-Fuzz repository * [oss-fuzz/projects/example](..) * [Dockerfile](../Dockerfile): sets up the build environment - * [build.sh](../build.sh): builds the fuzz target(s). The smaller this file the better, most of the logic should be inside the project's build system). + * [build.sh](../build.sh): builds the fuzz target(s). The smaller this file the better (most of the logic should be inside the project's build system). * [project.yaml](../project.yaml): short project description and contact info. ## Example bug diff --git a/projects/example/my-api-repo/standalone_fuzz_target_runner.cpp b/projects/example/my-api-repo/standalone_fuzz_target_runner.cpp index aecd1c987..3f1a49be3 100644 --- a/projects/example/my-api-repo/standalone_fuzz_target_runner.cpp +++ b/projects/example/my-api-repo/standalone_fuzz_target_runner.cpp @@ -30,6 +30,7 @@ int main(int argc, char **argv) { assert(in); LLVMFuzzerTestOneInput(reinterpret_cast(bytes.data()), bytes.size()); - std::cout << "Execution successfull" << std::endl; + std::cout << "Execution successful" << std::endl; } + return 0; } diff --git a/projects/qpdf/project.yaml b/projects/qpdf/project.yaml index 2fe5bb3ed..2b37e0dcd 100644 --- a/projects/qpdf/project.yaml +++ b/projects/qpdf/project.yaml @@ -1,5 +1,7 @@ homepage: "http://qpdf.sourceforge.net/" primary_contact: "taking@google.com" +auto_ccs: + - "qberkenbilt@gmail.com" sanitizers: - address