@@ -6,8 +6,8 @@ This directory contains files related to GitPython's suite of fuzz tests that ar
66infrastructure provided by [ OSS-Fuzz] [ oss-fuzz-repo ] . This document aims to provide necessary information for working
77with fuzzing in GitPython.
88
9- The latest details regarding OSS-Fuzz test status, including build logs and coverage reports, is made available
10- at [ this link ] ( https://introspector.oss-fuzz.com/project-profile?project=gitpython ) .
9+ The latest details regarding OSS-Fuzz test status, including build logs and coverage reports, is available
10+ on [ the Open Source Fuzzing Introspection website ] ( https://introspector.oss-fuzz.com/project-profile?project=gitpython ) .
1111
1212## How to Contribute
1313
@@ -129,47 +129,45 @@ This approach uses Docker images provided by OSS-Fuzz for building and running f
129129comprehensive features but requires a local clone of the OSS-Fuzz repository and sufficient disk space for Docker
130130containers.
131131
132- #### Preparation
133-
134- Set environment variables to simplify command usage:
135-
136- ``` shell
137- # $SANITIZER can be either 'address' or 'undefined':
138- export SANITIZER=address
139- # specify the fuzz target without the .py extension:
140- export FUZZ_TARGET=fuzz_config
141- ```
142-
143- #### Build and Run
132+ #### Build the Execution Environment
144133
145134Clone the OSS-Fuzz repository and prepare the Docker environment:
146135
147136``` shell
148137git clone --depth 1 https://github.com/google/oss-fuzz.git oss-fuzz
149138cd oss-fuzz
150139python infra/helper.py build_image gitpython
151- python infra/helper.py build_fuzzers --sanitizer $SANITIZER gitpython
140+ python infra/helper.py build_fuzzers --sanitizer address gitpython
152141```
153142
154143> [ !TIP]
155- > The ` build_fuzzers ` command above accepts a local file path pointing to your gitpython repository clone as the last
144+ > The ` build_fuzzers ` command above accepts a local file path pointing to your GitPython repository clone as the last
156145> argument.
157146> This makes it easy to build fuzz targets you are developing locally in this repository without changing anything in
158147> the OSS-Fuzz repo!
159148> For example, if you have cloned this repository (or a fork of it) into: ` ~/code/GitPython `
160149> Then running this command would build new or modified fuzz targets using the ` ~/code/GitPython/fuzzing/fuzz-targets `
161150> directory:
162151> ``` shell
163- > python infra/helper.py build_fuzzers --sanitizer $SANITIZER gitpython ~ /code/GitPython
152+ > python infra/helper.py build_fuzzers --sanitizer address gitpython ~ /code/GitPython
164153> ` ` `
165154
166-
167155Verify the build of your fuzzers with the optional ` check_build` command:
168156
169157` ` ` shell
170158python infra/helper.py check_build gitpython
171159```
172160
161+ #### Run a Fuzz Target
162+
163+ Setting an environment variable for the fuzz target argument of the execution command makes it easier to quickly select
164+ a different target between runs:
165+
166+ ``` shell
167+ # specify the fuzz target without the .py extension:
168+ export FUZZ_TARGET=fuzz_config
169+ ```
170+
173171Execute the desired fuzz target:
174172
175173``` shell
0 commit comments