Fuzzer Migration Follow-ups by DaveLak · Pull Request #1903 · gitpython-developers/GitPython
The latest details regarding OSS-Fuzz test status, including build logs and coverage reports, is made available at [this link](https://introspector.oss-fuzz.com/project-profile?project=gitpython). The latest details regarding OSS-Fuzz test status, including build logs and coverage reports, is available on [the Open Source Fuzzing Introspection website](https://introspector.oss-fuzz.com/project-profile?project=gitpython).
## How to Contribute
#### Preparation
Set environment variables to simplify command usage:
```shell # $SANITIZER can be either 'address' or 'undefined': export SANITIZER=address # specify the fuzz target without the .py extension: export FUZZ_TARGET=fuzz_config ```
#### Build and Run #### Build the Execution Environment
Clone the OSS-Fuzz repository and prepare the Docker environment:
```shell git clone --depth 1 https://github.com/google/oss-fuzz.git oss-fuzz cd oss-fuzz python infra/helper.py build_image gitpython python infra/helper.py build_fuzzers --sanitizer $SANITIZER gitpython python infra/helper.py build_fuzzers --sanitizer address gitpython ```
> [!TIP] > The `build_fuzzers` command above accepts a local file path pointing to your gitpython repository clone as the last > The `build_fuzzers` command above accepts a local file path pointing to your GitPython repository clone as the last > argument. > This makes it easy to build fuzz targets you are developing locally in this repository without changing anything in > the OSS-Fuzz repo! > For example, if you have cloned this repository (or a fork of it) into: `~/code/GitPython` > Then running this command would build new or modified fuzz targets using the `~/code/GitPython/fuzzing/fuzz-targets` > directory: > ```shell > python infra/helper.py build_fuzzers --sanitizer $SANITIZER gitpython ~/code/GitPython > python infra/helper.py build_fuzzers --sanitizer address gitpython ~/code/GitPython > ```
Verify the build of your fuzzers with the optional `check_build` command:
```shell python infra/helper.py check_build gitpython ```
#### Run a Fuzz Target
Setting an environment variable for the fuzz target argument of the execution command makes it easier to quickly select a different target between runs:
```shell # specify the fuzz target without the .py extension: export FUZZ_TARGET=fuzz_config ```
Execute the desired fuzz target:
```shell