{{ message }}
Repository navigation
Conversation
An unknown object format is reported as soon as the capability is seen, before the rest of the header is read, so the claim that GIT_ENOTSUPPORTED is only returned after the whole header has been validated is not quite true. Describe the exception and what the retained header holds in that case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fuzz the internal bundle header parser, including how it replaces, releases, and reuses the header that it owns. Each input is parsed through both the memory backing and a callback that returns a few bytes at a time, into parsers that already hold a valid header; the two results must agree, satisfy a few structural invariants, and leave the parsers reusable and cleanly disposable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add small seeds for the bundle header fuzzer covering supported headers (v2, v3 with SHA-1 and SHA-256), unsupported capabilities and object formats, ordering and syntax errors, byte handling (NUL, CRLF, trailing pack bytes), and a header line that crosses the 8192-byte internal read chunk. Bundle headers are byte-exact, so mark the corpus as not text; otherwise line-ending conversion on checkout would turn the valid seeds into malformed ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A header line of exactly the maximum length must be accepted and one byte more rejected. Neither boundary was tested, and the fuzz target cannot tell an off-by-one in the limit from correct behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follow-up to #7338. Add fuzz coverage for the internal bundle header parser, including replacement of an owned result, cleanup after malformed input, and reuse after supported or unsupported headers. This changes no parser behavior and adds no public API.
Changes
bundle_fuzzer, using the existing fuzzer discovery and standalone corpus-replay infrastructure. Each input is parsed through both the memory entry point and a callback returning at most seven bytes per read, without seeking. Both parsers initially hold a valid header, and their return codes and retained results must agree field by field.17 <= pack_offset <= input size. Reparse a known header to check recovery, then dispose each parser twice.-text -whitespaceto preserve intentional byte sequences and malformed whitespace across checkouts.bundle.hcomment: an unknown object format returnsGIT_ENOTSUPPORTEDbefore the remaining header is validated.docs/fuzzing.md: standalone fuzzers can coexist with tests and examples, and libFuzzer builds need-fsanitize=fuzzer-no-linkinCFLAGSto instrument the library objects.Validation
Mutation campaigns ran with libFuzzer, ASan, UBSan, and LeakSanitizer using Debian Clang 19.1.7 on aarch64 Linux in Docker. A deliberately leaking test program first confirmed that leak detection worked. The campaign builds included
-fsanitize=fuzzer-no-linkinCFLAGSto instrument parser code.No crashes, leaks, or timeouts were reported. The final run produced no artifacts. Mutation did not grow inputs close to the 1 MiB line limit, so boundary inputs were exercised separately.
libgit2_tests -sbundle::parsepassed.dispose(NULL). The harness does not inject source or allocation failures.ENABLE_WERROR=ONusing Apple Clang 17. A final local recheck passed all nine fuzzer replay tests and all 29bundle::parsetests.git diff --checkpasses.ASan hangs at startup on the macOS host, so ASan validation ran on Linux. Windows/MSVC validation is left to CI.