2019-08-07 14:37:16 +00:00
---
layout: default
2019-08-12 21:15:33 +00:00
title: Setting up a new project
2019-08-07 14:37:16 +00:00
parent: Getting started
nav_order: 2
permalink: /getting-started/new-project-guide/
---
2019-08-07 14:44:45 +00:00
# Setting up a new project
2019-08-12 21:15:33 +00:00
{: .no_toc}
2019-08-07 14:44:45 +00:00
- TOC
{:toc}
---
2016-08-29 20:38:51 +00:00
## Prerequisites
2019-08-12 21:15:33 +00:00
Before you can start setting up your new project for fuzzing, you must do the following:
- [Integrate ]({{ site.baseurl }}/advanced-topics/ideal-integration/ ) one or more [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target )
2019-08-07 14:37:16 +00:00
with the project you want to fuzz.
2019-08-12 21:15:33 +00:00
For examples, see
2016-12-02 16:51:43 +00:00
[boringssl ](https://github.com/google/boringssl/tree/master/fuzz ),
[SQLite ](https://www.sqlite.org/src/artifact/ad79e867fb504338 ),
[s2n ](https://github.com/awslabs/s2n/tree/master/tests/fuzz ),
[openssl ](https://github.com/openssl/openssl/tree/master/fuzz ),
[FreeType ](http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/tools/ftfuzzer ),
[re2 ](https://github.com/google/re2/tree/master/re2/fuzzing ),
[harfbuzz ](https://github.com/behdad/harfbuzz/tree/master/test/fuzzing ),
2019-08-12 21:15:33 +00:00
[pcre2 ](http://vcs.pcre.org/pcre2/code/trunk/src/pcre2_fuzzsupport.c?view=markup ), and
2017-01-31 15:42:27 +00:00
[ffmpeg ](https://github.com/FFmpeg/FFmpeg/blob/master/tools/target_dec_fuzzer.c ).
2016-12-02 16:52:30 +00:00
2019-08-12 21:15:33 +00:00
- [Install Docker ](https://docs.docker.com/engine/installation )
(Googlers can visit [go/installdocker ](https://goto.google.com/installdocker )).
2019-08-07 14:37:16 +00:00
[Why Docker? ]({{ site.baseurl }}/faq/#why-do-you-use-docker )
2016-12-02 16:51:43 +00:00
2019-08-12 21:15:33 +00:00
If you want to run `docker` without `sudo` , you can
[create a docker group ](https://docs.docker.com/engine/installation/linux/ubuntulinux/#/create-a-docker-group ).
2016-10-12 01:26:42 +00:00
2019-08-12 21:15:33 +00:00
**Note:** Docker images can consume significant disk space. Run
[docker-cleanup ](https://gist.github.com/mikea/d23a839cba68778d94e0302e8a2c200f )
periodically to garbage-collect unused images.
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
## Creating the file structure
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
Each OSS-Fuzz project has a subdirectory
inside the [`projects/` ](https://github.com/google/oss-fuzz/tree/master/projects ) directory in the [OSS-Fuzz repository ](https://github.com/google/oss-fuzz ). For example, the [boringssl ](https://github.com/google/boringssl )
project is located in [`projects/boringssl` ](https://github.com/google/oss-fuzz/tree/master/projects/boringssl ).
2016-11-30 04:19:44 +00:00
2019-08-12 21:15:33 +00:00
Each project directory also contains the following three configuration files:
* [project.yaml ](#project.yaml ) - provides metadata about the project.
* [Dockerfile ](#Dockerfile ) - defines the container environment with information
2019-08-07 14:37:16 +00:00
on dependencies needed to build the project and its [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ).
2019-08-12 21:15:33 +00:00
* [build.sh ](#build.sh ) - defines the build script that executes inside the Docker container and
generates the project build.
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
You can automatically create a new directory for your project in OSS-Fuzz and
generate templated versions of the configuration files
by running the following commands:
2016-09-01 18:43:44 +00:00
```bash
2016-09-27 18:39:04 +00:00
$ cd /path/to/oss-fuzz
2016-11-30 04:19:44 +00:00
$ export PROJECT_NAME=< project_name >
2016-11-29 19:27:56 +00:00
$ python infra/helper.py generate $PROJECT_NAME
2016-09-01 18:43:44 +00:00
```
2019-08-15 22:07:23 +00:00
Once the template configuration files are created, you can modify them to fit your project.
2019-08-12 21:15:33 +00:00
**Note:** We prefer that you keep and maintain [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ) in your own source code repository. If this isn't possible, you can store them inside the OSS-Fuzz project directory you created.
2016-09-27 21:07:19 +00:00
2017-02-14 16:58:06 +00:00
## project.yaml
2019-08-12 21:15:33 +00:00
This configuration file stores project metadata. The following attributes are supported:
- [homepage ](#homepage )
- [primary_contact ](#primary )
- [auto_ccs ](#primary )
- [sanitizers ](#sanitizers ) (optional)
2019-08-19 21:07:33 +00:00
- [architectures ](#architectures ) (optional)
2019-08-15 22:07:23 +00:00
- [help_url ](#help_url ) (optional)
2017-02-14 16:58:06 +00:00
2018-05-04 03:35:58 +00:00
### homepage
2019-08-12 21:15:33 +00:00
You project's homepage.
### primary_contact, auto_ccs {#primary}
The primary contact and list of other contacts to be CCed. Each person listed gets access to ClusterFuzz, including crash reports and fuzzer statistics, and are auto-cced on new bugs filed in the OSS-Fuzz
tracker. If you're a primary or a CC, you'll need to use a [Google account ](https://support.google.com/accounts/answer/176347?hl=en ) to get full access. ([why?]({{ site.baseurl }}/faq/#why-do-you-require-a-google-account-for-authentication)).
### sanitizers (optional) {#sanitizers}
The list of sanitizers to use. If you don't specify a list, `sanitizers` uses a default list of supported
sanitizers (currently ["address" ](https://clang.llvm.org/docs/AddressSanitizer.html ) and
2018-05-04 03:35:58 +00:00
["undefined" ](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html )).
2019-08-15 22:07:23 +00:00
[MemorySanitizer ](https://clang.llvm.org/docs/MemorySanitizer.html ) ("memory") is also supported
and recommended, but is not enabled by default due to the likelihood of false positives from
un-instrumented system dependencies. If you want to use "memory," first make sure your project's
runtime dependencies are listed in the OSS-Fuzz
2019-08-12 21:15:33 +00:00
[msan-builder Dockerfile ](https://github.com/google/oss-fuzz/blob/master/infra/base-images/msan-builder/Dockerfile#L20 ).
Then, you can opt in by adding "memory" to your list of sanitizers.
2018-05-04 03:35:58 +00:00
2019-08-12 21:15:33 +00:00
If your project does not build with a particular sanitizer configuration and you need some time to fix
it, you can use `sanitizers` to override the defaults temporarily. For example, to disable the
UndefinedBehaviourSanitizer build, just specify all supported sanitizers except "undefined".
2018-05-04 03:35:58 +00:00
2019-08-12 21:15:33 +00:00
If you want to test a particular sanitizer to see what crashes it generates without filing
them in the issue tracker, you can set an `experimental` flag. For example, if you want to test "memory", set `experimental: True` like this:
2018-07-24 16:54:02 +00:00
```
sanitizers:
- address
- memory:
experimental: True
- undefined
```
2019-08-12 21:15:33 +00:00
Crashes can be accessed on the [ClusterFuzz
homepage]({{ site.baseurl }}/furthur-reading/clusterfuzz#web-interface).
`sanitizers` example: [boringssl ](https://github.com/google/oss-fuzz/blob/master/projects/boringssl/project.yaml ).
2018-08-03 14:18:27 +00:00
2019-08-19 21:07:33 +00:00
### architectures (optional) {#architectures}
The list of architectures to fuzz on.
ClusterFuzz supports fuzzing on x86_64 (aka x64) by default.
However you can also fuzz using AddressSanitizer and libFuzzer on i386 (aka x86, or 32 bit) by specifying "x86_64" and "i386" in "architectures" like this:
```yaml
architectures:
- x86_64
- i386
```
By fuzzing on i386 you might find bugs that:
* Only occur in architecture-specific source code (e.g. code that contains i386 assembly).
* Exist in architecture-independent source code and which only affects i386 users.
* Exist in architecture-independent source code and which affects users on other 32-bit platforms such as AArch32 (aka 32-bit ARM).
Note that some bugs which affect x86_64 may be discovered on i386 and filed as such.
On the testcase page of each oss-fuzz issue is a list of other jobs where the crash reproduces, this can let you know if the crash exists on x86_64 as well.
Fuzzing on i386 is not enabled by default because many projects won't build for i386 without some modification to their OSS-Fuzz build process.
For example, you will need to link against `$LIB_FUZZING_ENGINE` and possibly install i386 dependencies within the x86_64 docker image ([for example](https://github.com/google/oss-fuzz/blob/5b8dcb5d942b3b8bc173b823fb9ddbdca7ec6c99/projects/gdal/build.sh#L18)) to get things working.
### help_url (optional) {#help_url}
2019-08-12 21:15:33 +00:00
A link to a custom help URL that appears in bug reports instead of the default
[OSS-Fuzz guide to reproducing crashes ]({{ site.baseurl }}/advanced-topics/reproducing/ ). This can be useful if you assign
bugs to members of your project unfamiliar with OSS-Fuzz, or if they should follow a different workflow for
reproducing and fixing bugs than the standard one outlined in the reproducing guide.
2017-02-14 16:58:06 +00:00
2019-08-12 21:15:33 +00:00
`help_url` example: [skia ](https://github.com/google/oss-fuzz/blob/master/projects/skia/project.yaml ).
2017-02-14 16:58:06 +00:00
2016-09-27 19:17:38 +00:00
## Dockerfile
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
This configuration file defines the Docker image for your project. Your [build.sh ](#build.sh ) script will be executed in inside the container you define.
For most projects, the image is simple:
2016-10-12 23:25:06 +00:00
```docker
2017-04-04 18:12:31 +00:00
FROM gcr.io/oss-fuzz-base/base-builder # base image with clang toolchain
2016-11-30 04:19:44 +00:00
MAINTAINER YOUR_EMAIL # maintainer for this file
2017-05-02 06:34:47 +00:00
RUN apt-get update & & apt-get install -y ... # install required packages to build your project
2016-11-30 17:24:04 +00:00
RUN git clone < git_url > < checkout_dir > # checkout all sources needed to build your project
2016-11-17 17:49:34 +00:00
WORKDIR < checkout_dir > # current directory for build script
2016-11-30 04:19:44 +00:00
COPY build.sh fuzzer.cc $SRC/ # copy build script and other fuzzer files in src dir
2016-08-29 20:38:51 +00:00
```
2019-08-12 21:15:33 +00:00
In the above example, the git clone will check out the source to `$SRC/<checkout_dir>` .
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
For an example in Expat, see [expat/Dockerfile ](https://github.com/google/oss-fuzz/tree/master/projects/expat/Dockerfile )
2017-03-23 21:56:59 +00:00
2016-09-27 19:17:38 +00:00
## build.sh
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
This file defines how to build binaries for [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ) in your project.
The script is executed within the image built from your [Dockerfile ](#Dockerfile ).
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
In general, this script should do the following:
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
- Build the project using your build system with the correct compiler.
- Provide compiler flags as [environment variables ](#Requirements ).
- Build your [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ) and link your project's build with libFuzzer.
Resulting binaries should be placed in `$OUT` .
2016-08-29 20:38:51 +00:00
2019-08-15 22:07:23 +00:00
Here's an example from Expat ([source](https://github.com/google/oss-fuzz/blob/master/projects/expat/build.sh)):
2016-08-29 20:38:51 +00:00
```bash
#!/bin/bash -eu
./buildconf.sh
2016-09-27 20:41:52 +00:00
# configure scripts usually use correct environment variables.
2016-08-29 20:38:51 +00:00
./configure
2016-09-27 20:41:52 +00:00
2016-11-30 04:28:51 +00:00
make clean
make -j$(nproc) all
2016-08-29 20:38:51 +00:00
$CXX $CXXFLAGS -std=c++11 -Ilib/ \
2016-11-30 04:28:51 +00:00
$SRC/parse_fuzzer.cc -o $OUT/parse_fuzzer \
2019-04-15 17:05:02 +00:00
$LIB_FUZZING_ENGINE .libs/libexpat.a
2016-11-30 04:28:51 +00:00
cp $SRC/*.dict $SRC/*.options $OUT/
2016-08-29 20:38:51 +00:00
```
2019-08-12 21:15:33 +00:00
**Notes:**
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
1. Don't assume the fuzzing engine is libFuzzer by default, because we generate builds for both libFuzzer and AFL fuzzing engine configurations. Instead, link the fuzzing engine using $LIB_FUZZING_ENGINE.
2. Make sure that the binary names for your [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ) contain only
alphanumeric characters, underscore(_) or dash(-). Otherwise, they won't run on our infrastructure.
3. Don't remove source code files. They are needed for code coverage.
### build.sh script environment
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
When your build.sh script is executed, the following locations are available within the image:
2016-08-29 20:38:51 +00:00
2019-08-15 22:07:23 +00:00
| Location| Env Variable | Description |
|---------| ------------ | ---------- |
2016-12-07 19:41:08 +00:00
| `/out/` | `$OUT` | Directory to store build artifacts (fuzz targets, dictionaries, options files, seed corpus archives). |
2019-08-12 21:15:33 +00:00
| `/src/` | `$SRC` | Directory to checkout source files. |
2019-08-15 22:07:23 +00:00
| `/work/` | `$WORK` | Directory to store intermediate files. |
2016-12-07 19:41:08 +00:00
2019-08-12 21:15:33 +00:00
Although the files layout is fixed within a container, environment variables are
provided so you can write retargetable scripts.
2016-09-27 20:41:52 +00:00
2019-08-12 21:15:33 +00:00
### build.sh requirements {#Requirements}
2018-11-19 22:04:12 +00:00
2019-08-12 21:15:33 +00:00
Only binaries without an extension are accepted as targets. Extensions are reserved for other artifacts, like .dict.
2019-03-08 01:00:20 +00:00
2016-11-30 04:19:44 +00:00
You *must* use the special compiler flags needed to build your project and fuzz targets.
These flags are provided in the following environment variables:
2016-09-27 20:41:52 +00:00
2016-10-13 21:19:30 +00:00
| Env Variable | Description
| ------------- | --------
| `$CC` , `$CXX` , `$CCC` | The C and C++ compiler binaries.
| `$CFLAGS` , `$CXXFLAGS` | C and C++ compiler flags.
2019-04-15 17:05:02 +00:00
| `$LIB_FUZZING_ENGINE` | C++ compiler argument to link fuzz target against the prebuilt engine library (e.g. libFuzzer).
2016-09-27 20:41:52 +00:00
2018-11-19 22:05:01 +00:00
You *must* use `$CXX` as a linker, even if your project is written in pure C.
2018-11-19 22:04:12 +00:00
2016-11-30 04:19:44 +00:00
Most well-crafted build scripts will automatically use these variables. If not,
pass them manually to the build tool.
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
See the [Provided Environment Variables ](https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/README.md#provided-environment-variables ) section in
2016-12-29 21:39:41 +00:00
`base-builder` image documentation for more details.
2016-10-13 21:03:43 +00:00
2017-05-04 20:50:15 +00:00
## Disk space restrictions
Our builders have a disk size of 70GB (this includes space taken up by the OS). Builds must keep peak disk usage below this.
2019-08-12 21:15:33 +00:00
In addition, please keep the size of the build (everything copied to `$OUT` ) small (< 10GB uncompressed ). The build is repeatedly transferred and unzipped during fuzzing and runs on VMs with limited disk space .
2017-05-04 20:50:15 +00:00
2017-02-07 17:35:26 +00:00
## Fuzzer execution environment
2019-08-12 21:15:33 +00:00
For more on the environment that
your [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ) run in, and the assumptions you can make, see the [fuzzer environment ]({{ site.baseurl }}/furthur-reading/fuzzer-environment/ ) page.
2016-11-07 20:28:32 +00:00
## Testing locally
2019-08-12 21:15:33 +00:00
You can build your docker image and fuzz targets locally, so you can test them before you push them to the OSS-Fuzz repository.
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
1. Run the same helper script you used to create your directory structure, this time using it to build your docker image and [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ):
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
```bash
$ cd /path/to/oss-fuzz
$ python infra/helper.py build_image $PROJECT_NAME
$ python infra/helper.py build_fuzzers --sanitizer < address / memory / undefined > $PROJECT_NAME
```
2017-01-14 19:46:45 +00:00
2019-08-12 21:15:33 +00:00
The built binaries appear in the `/path/to/oss-fuzz/build/out/$PROJECT_NAME`
directory on your machine (and `$OUT` in the container).
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
**Note:** You *must* run your fuzz target binaries inside the base-runner docker
container to make sure that they work properly.
2018-12-08 16:38:24 +00:00
2019-08-12 21:15:33 +00:00
2. Find failures to fix by running the `check_build` command:
```bash
$ python infra/helper.py check_build $PROJECT_NAME
```
2018-12-08 16:38:24 +00:00
2019-08-12 21:15:33 +00:00
3. If you want to test changes against a particular fuzz target, run the following command:
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
```bash
$ python infra/helper.py run_fuzzer $PROJECT_NAME < fuzz_target >
```
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
4. We recommend taking a look at your code coverage as a sanity check to make sure that your
fuzz targets get to the code you expect:
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
```bash
$ python infra/helper.py build_fuzzers --sanitizer coverage $PROJECT_NAME
$ python infra/helper.py coverage $PROJECT_NAME < fuzz_target >
```
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
**Note:** Currently, we only support AddressSanitizer (address) and UndefinedBehaviorSanitizer (undefined)
2019-08-15 22:07:23 +00:00
configurations. MemorySanitizer is recommended, but needs to be enabled manually once you verify
that all system dependencies are
[instrumented ](https://github.com/google/oss-fuzz/blob/master/infra/base-images/msan-builder/Dockerfile#L20 ).
< b > Make sure to test each
2017-02-07 23:23:00 +00:00
of the supported build configurations with the above commands (build_fuzzers -> run_fuzzer -> coverage).< / b >
2016-11-07 20:28:32 +00:00
2019-08-12 21:15:33 +00:00
If everything works locally, it should also work on our automated builders and ClusterFuzz. If you check in
your files and experience failures, review your [dependencies ]({{ site.baseurl }}/furthur-reading/fuzzer-environment/#dependencies ).
2016-11-07 20:28:32 +00:00
## Debugging Problems
2019-08-12 21:15:33 +00:00
If you run into problems, our [Debugging page ]({{ site.baseurl }}/advanced-topics/debugging/ ) lists ways to debug your build scripts and
[fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target ).
2016-11-07 20:28:32 +00:00
2019-08-12 18:29:53 +00:00
## Efficient fuzzing
2016-11-07 20:28:32 +00:00
2019-08-15 22:07:23 +00:00
To improve your fuzz target ability to find bugs faster, you should consider the
following ways:
2016-10-28 22:13:26 +00:00
### Seed Corpus
2016-10-28 22:09:44 +00:00
2016-11-29 22:05:11 +00:00
OSS-Fuzz uses evolutionary fuzzing algorithms. Supplying seed corpus consisting
2019-08-07 14:37:16 +00:00
of good sample inputs is one of the best ways to improve [fuzz target ]({{ site.baseurl }}/reference/glossary/#fuzz-target )'s coverage.
2016-10-28 22:09:44 +00:00
To provide a corpus for `my_fuzzer` , put `my_fuzzer_seed_corpus.zip` file next
2019-08-07 14:37:16 +00:00
to the [fuzz target ]({{ site.baseurl }}/reference/glossary/#fuzz-target )'s binary in `$OUT` during the build. Individual files in this
2019-06-13 20:57:22 +00:00
archive will be used as starting inputs for mutations. The name of each file in the corpus is the sha1 checksum (which you can get using the `sha1sum` or `shasum` comand) of its contents. You can store the corpus
2016-12-07 19:35:53 +00:00
next to source files, generate during build or fetch it using curl or any other
tool of your choice.
2016-12-05 02:59:29 +00:00
(example: [boringssl ](https://github.com/google/oss-fuzz/blob/master/projects/boringssl/build.sh#L41 )).
2016-10-28 22:09:44 +00:00
Seed corpus files will be used for cross-mutations and portions of them might appear
in bug reports or be used for further security research. It is important that corpus
has an appropriate and consistent license.
2019-08-07 14:37:16 +00:00
See also [Accessing Corpora ]({{ site.baseurl }}/advanced-topics/corpora/ ) for information about getting access to the corpus we are currently using for your fuzz targets.
2019-06-13 20:57:22 +00:00
2016-10-13 15:24:56 +00:00
### Dictionaries
2016-08-30 21:20:32 +00:00
2017-02-08 03:15:53 +00:00
Dictionaries hugely improve fuzzing efficiency for inputs with lots of similar
2016-12-03 05:01:03 +00:00
sequences of bytes. [libFuzzer documentation ](http://libfuzzer.info#dictionaries )
2016-08-29 20:38:51 +00:00
2017-05-24 20:56:06 +00:00
Put your dict file in `$OUT` . If the dict filename is the same as your target
2018-07-17 19:38:09 +00:00
binary name (i.e. `%fuzz_target%.dict` ), it will be automatically used. If the
name is different (e.g. because it is shared by several targets), specify this
in .options file:
2016-10-13 15:24:56 +00:00
```
[libfuzzer]
dict = dictionary_name.dict
```
2016-08-29 20:38:51 +00:00
2019-08-07 14:37:16 +00:00
It is common for several [fuzz targets ]({{ site.baseurl }}/reference/glossary/#fuzz-target )
2016-12-03 05:01:03 +00:00
to reuse the same dictionary if they are fuzzing very similar inputs.
2016-11-30 05:14:25 +00:00
(example: [expat ](https://github.com/google/oss-fuzz/blob/master/projects/expat/parse_fuzzer.options )).
2016-10-17 19:39:28 +00:00
2019-08-15 22:07:23 +00:00
### Input Size
2019-08-12 18:29:53 +00:00
2019-08-15 22:07:23 +00:00
By default, the fuzzing engine will generate input of any arbitrary length.
2019-08-15 23:33:07 +00:00
This might be useful to try corner cases that could lead to a
security vulnerability. However, if large inputs are not necessary to
increase the coverage of your target API, it is important to add a limit
here to significantly improve performance.
2019-08-12 18:29:53 +00:00
```cpp
if (size < kMinInputLength | | size > kMaxInputLength)
return 0;
```
2019-08-12 21:15:33 +00:00
## Checking in to the OSS-Fuzz repository
2016-08-29 20:38:51 +00:00
2019-08-15 22:07:23 +00:00
Once you've tested your fuzzing files locally, fork OSS-Fuzz, commit, and push to the fork. Then
create a pull request with your change. Follow the
[Forking Project ](https://guides.github.com/activities/forking/ ) guide if you're new to contributing
via GitHub.
2016-08-29 20:38:51 +00:00
### Copyright headers
Please include copyright headers for all files checked in to oss-fuzz:
```
2019-06-24 14:44:17 +00:00
# Copyright 2019 Google Inc.
2016-08-29 20:38:51 +00:00
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
```
2019-08-12 21:15:33 +00:00
**Exception:** If you're porting a fuzz target from Chromium, keep the original Chromium license header.
2016-08-29 20:38:51 +00:00
2019-08-12 21:15:33 +00:00
## Reviewing results
2016-08-29 20:38:51 +00:00
2016-11-30 04:28:51 +00:00
Once your change is merged, your project and fuzz targets should be automatically built and run on
2019-08-12 21:15:33 +00:00
ClusterFuzz after a short while (< 1 day). If you think there's a problem, you can check your project's [build status ](https://oss-fuzz-build-logs.storage.googleapis.com/index.html ).
2017-04-21 14:56:31 +00:00
2019-08-12 21:15:33 +00:00
Use the [ClusterFuzz web interface ](https://oss-fuzz.com/ ) to review the following:
2017-04-21 14:56:31 +00:00
* Crashes generated
* Code coverage statistics
* Fuzzer statistics
* Fuzzer performance analyzer (linked from fuzzer statistics)
2019-06-13 20:57:22 +00:00
2019-08-12 21:15:33 +00:00
**Note:** Your Google Account must be listed in [project.yaml ](#projectyaml ) for you to have access to the ClusterFuzz web interface.