@@ -6,8 +6,8 @@ This directory contains files related to GitPython's suite of fuzz tests that ar
6
6
infrastructure provided by [ OSS-Fuzz] [ oss-fuzz-repo ] . This document aims to provide necessary information for working
7
7
with fuzzing in GitPython.
8
8
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 ) .
11
11
12
12
## How to Contribute
13
13
@@ -129,47 +129,45 @@ This approach uses Docker images provided by OSS-Fuzz for building and running f
129
129
comprehensive features but requires a local clone of the OSS-Fuzz repository and sufficient disk space for Docker
130
130
containers.
131
131
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
144
133
145
134
Clone the OSS-Fuzz repository and prepare the Docker environment:
146
135
147
136
``` shell
148
137
git clone --depth 1 https://github.com/google/oss-fuzz.git oss-fuzz
149
138
cd oss-fuzz
150
139
python 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
152
141
```
153
142
154
143
> [ !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
156
145
> argument.
157
146
> This makes it easy to build fuzz targets you are developing locally in this repository without changing anything in
158
147
> the OSS-Fuzz repo!
159
148
> For example, if you have cloned this repository (or a fork of it) into: ` ~/code/GitPython `
160
149
> Then running this command would build new or modified fuzz targets using the ` ~/code/GitPython/fuzzing/fuzz-targets `
161
150
> directory:
162
151
> ``` 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
164
153
> ` ` `
165
154
166
-
167
155
Verify the build of your fuzzers with the optional ` check_build` command:
168
156
169
157
` ` ` shell
170
158
python infra/helper.py check_build gitpython
171
159
```
172
160
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
+
173
171
Execute the desired fuzz target:
174
172
175
173
``` shell
0 commit comments