Repository navigation
Conversation
Add a fuzz/ workspace with two libFuzzer harnesses: - postcard_roundtrip_fuzzer: decode -> re-encode -> re-decode -> assert equal - postcard_decoder_fuzzer: pure deserialization + COBS framing over arbitrary bytes Compile-validated against the local postcard crate (v1.1.3, use-std).
✅ Deploy Preview for cute-starship-2d9c9b canceled.
|
- extract duplicated FuzzValue enum into fuzz_targets/common.rs - roundtrip: assert all three framing paths stable (varint heap, varint slice, COBS) instead of one dead to_slice call on raw input - decoder: use shared FuzzValue, keep payload-shape + COBS coverage
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.
Summary
Adds a
fuzz/workspace with two libFuzzer targets to support OSS-Fuzz onboarding:postcard_roundtrip_fuzzer— decode arbitrary bytes → re-encode → re-decode → assert equal. Catches encode/decode asymmetry and stack overflows on deeply-nested input.postcard_decoder_fuzzer— pure deserialization coverage over arbitrary (mostly malformed) bytes, plus the COBS framing path.Both drive a recursive
FuzzValueenum covering every serde type path (bool/int/uint/float/str/bytes/seq/map). postcard is a binary, non-self-describing format, so attacker-controlled varint length prefixes, string/map/sequence lengths, and COBS framing are the correct fuzz surface.Verification
Compile-validated against the local
postcardcrate (v1.1.3,use-stdfeature) —cargo checkpasses on all API usage (from_bytes,to_stdvec,to_slice,from_bytes_cobs).Notes
fuzz/is its own workspace so it does not collide with the root workspace.postcarddependency is referenced viapath = "../source/postcard"to match the repo layout.projects/postcard/config ingoogle/oss-fuzz).