Skip to content

Commit

Permalink
Remove comment suggesting the undefined sanitizer is a valid option
Browse files Browse the repository at this point in the history
Also makes come structural improvements to how the local instructions
for running OSS-Fuzz are presented now that only the single `address`
sanitizer is a valid option.

The `undefined` sanitizer was removed from GitPython's `project.yaml`
OSS-Fuzz configuration file at the request of OSS-Fuzz project reviewers
in google/oss-fuzz#11803.

The `undefined` sanitizer is only useful in Python projects that use
native exstensions (such as C, C++, Rust, ect.), which GitPython does
not currently do. This commit updates the `fuzzing/README` reference to
that sanitizer accoirdingly.
See:
- google/oss-fuzz@b210fb2
- google/oss-fuzz#11803 (comment)
  • Loading branch information
DaveLak committed Apr 18, 2024
1 parent a30f9b9 commit 23a505f
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions fuzzing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,15 @@ This approach uses Docker images provided by OSS-Fuzz for building and running f
comprehensive features but requires a local clone of the OSS-Fuzz repository and sufficient disk space for Docker
containers.

#### 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]
Expand All @@ -160,16 +149,25 @@ python infra/helper.py build_fuzzers --sanitizer $SANITIZER 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
Expand Down

0 comments on commit 23a505f

Please sign in to comment.