@@ -6,7 +6,7 @@ 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 details about the latest OSS-Fuzz test status, including build logs and coverage reports, is made available
9+ The latest details regarding OSS-Fuzz test status, including build logs and coverage reports, is made available
1010at [ this link] ( https://introspector.oss-fuzz.com/project-profile?project=gitpython ) .
1111
1212## How to Contribute
@@ -23,7 +23,7 @@ Areas that are particularly appreciated include:
2323 update of any size, please consider suggesting it!
2424
2525For everything else, such as expanding test coverage, optimizing test performance, or enhancing error detection
26- capabilities, jump in to the "Getting Started" section below.
26+ capabilities, jump into the "Getting Started" section below.
2727
2828## Getting Started with Fuzzing GitPython
2929
@@ -63,7 +63,7 @@ The `fuzzing/` directory is organized into three key areas:
6363
6464### Fuzz Targets (` fuzz-targets/ ` )
6565
66- Contains Python files for each fuzz test, targeting specific functionalities of GitPython .
66+ Contains Python files for each fuzz test.
6767
6868** Things to Know** :
6969
@@ -81,7 +81,7 @@ Contains Python files for each fuzz test, targeting specific functionalities of
8181
8282Provides hints to the fuzzing engine about inputs that might trigger unique code paths. Each fuzz target may have a
8383corresponding ` .dict ` file. For details on how these are used, refer
84- to [ LibFuzzer documentation] ( https://llvm.org/docs/LibFuzzer.html#dictionaries ) .
84+ to the [ LibFuzzer documentation on the subject ] ( https://llvm.org/docs/LibFuzzer.html#dictionaries ) .
8585
8686** Things to Know** :
8787
@@ -105,6 +105,11 @@ Includes scripts for building and integrating fuzz targets with OSS-Fuzz:
105105- ** ` build.sh ` ** - Executed within the Docker container, this script builds fuzz targets with necessary instrumentation
106106 and prepares seed corpora and dictionaries for use.
107107
108+ ** Where to learn more:**
109+
110+ - [ OSS-Fuzz documentation on the build.sh] ( https://google.github.io/oss-fuzz/getting-started/new-project-guide/#buildsh )
111+ - [ See GitPython's build.sh and Dockerfile in the OSS-Fuzz repository] ( https://github.com/google/oss-fuzz/tree/master/projects/gitpython )
112+
108113## Running Fuzzers Locally
109114
110115### Direct Execution of Fuzz Targets
@@ -153,9 +158,21 @@ python infra/helper.py check_build gitpython
153158Execute the desired fuzz target:
154159
155160``` shell
156- python infra/helper.py run_fuzzer gitpython $FUZZ_TARGET
161+ python infra/helper.py run_fuzzer gitpython $FUZZ_TARGET -- -max_total_time=60 -print_final_stats=1
157162```
158163
164+ > [ !TIP]
165+ > In the example above, the "` -- -max_total_time=60 -print_final_stats=1 ` " portion of the command is optional but quite
166+ > useful.
167+ >
168+ > Every argument provided after "` -- ` " in the above command is passed to the fuzzing engine directly. In this case:
169+ > - ` -max_total_time=60 ` tells the LibFuzzer to stop execution after 60 seconds have elapsed.
170+ > - ` -print_final_stats=1 ` tells the LibFuzzer to print a summary of useful metrics about the target run upon
171+ completion.
172+ >
173+ > But almost any [ LibFuzzer option listed in the documentation] ( https://llvm.org/docs/LibFuzzer.html#options ) should
174+ > work as well.
175+
159176#### Next Steps
160177
161178For detailed instructions on advanced features like reproducing OSS-Fuzz issues or using the Fuzz Introspector, refer
0 commit comments