Overview of Dulwich fuzzing directory structure
mainThe fuzzing/ directory is organized into three main areas:
fuzz-targets/
Contains Python files for each fuzz test.
- Naming Convention:
fuzz_<API Under Test>.py. - Targeting: Tests should target functionality involving input data processing, especially parsing or untrusted user input.
- Error Handling: Fuzz tests should use
try/exceptblocks to handle anticipated exceptions gracefully, preventing false positives from halting the engine.
dictionaries/
Contains .dict files that provide hints to the fuzzing engine about specific input patterns to trigger unique code paths.
- Loading: OSS-Fuzz loads a dictionary file if it shares the same name as the fuzz target.
- Content: Entries are often escaped byte values recommended by the engine.
oss-fuzz-scripts/
Scripts used for building and integrating with OSS-Fuzz:
container-environment-bootstrap.sh: Sets up the execution environment and dependencies.build.sh: Builds targets with instrumentation and prepares seed corpora/dictionaries.