#4909·dragonfly

Add fuzz targets to support the OSS-Fuzz build of Dragonfly v2

Author: xingyanerCreated Aug 1, 2026Updated Aug 11, 2026
Labelsbug

Describe the situation Dragonfly v2 is integrated with OSS-Fuzz, but the OSS-Fuzz build currently fails because the fuzzer entry points referenced by the build script do not exist in this repository.

After the v2 restructure, the module path changed from github.com/dragonflyoss/Dragonfly to d7y.io/dragonfly/v2, and the previously referenced packages (dfget/core/uploader, supernode/daemon/mgr/cdn) were removed. The OSS-Fuzz build script needs Fuzz* entry points to exist inside the target packages (OSS-Fuzz's compile_go_fuzzer locates the function by grepping the package source); without them, no fuzzer binaries can be built.

Requested change Add three fuzz targets in the packages below:

- pkg/digest/fuzz.go — FuzzParse wrapping Parse
- pkg/net/http/fuzz.go — FuzzParseRange wrapping ParseRange / ParseURLMetaRange
- pkg/dfnet/fuzz.go — FuzzNetAddrJSON wrapping NetAddr.UnmarshalJSON

Expected behavior With these targets present, the OSS-Fuzz build (compile_go_fuzzer d7y.io/dragonfly/v2/pkg/digest FuzzParse fuzz_digest_parse, etc.) succeeds and produces the fuzzers fuzz_digest_parse, fuzz_http_range, and fuzz_dfnet_json. The targets can also be run locally via Go's native fuzzing (go test -fuzz=...).

Additional context

  • This change is coordinated with the OSS-Fuzz project config: the accompanying build script update is in the oss-fuzz PR google/oss-fuzz#15935, which updates projects/dragonfly/build.sh to build against the d7y.io/dragonfly/v2 packages and relies on these upstream fuzz targets.
  • check_build (libfuzzer/address/x86_64) passes for all three fuzzers once the targets are present.