Skip to content

OSS-Fuzz: Add new fuzzer/corpus/dict targets vref buffer packing - #1215

Open
arthurscchan wants to merge 1 commit into
msgpack:cpp_masterfrom
arthurscchan:msgpack-c-vrefbuffer-pack
Open

arthurscchan wants to merge 1 commit into
msgpack:cpp_masterfrom
arthurscchan:msgpack-c-vrefbuffer-pack

Conversation

@arthurscchan

Copy link
Copy Markdown

This PR adds a new OSS-Fuzz fuzzer with corpus/dict targets vref buffer packing, together with google/oss-fuzz#16492 to enable a new fuzzer, aiming to improve the overall fuzzing coverage and effectiveness for project msgpack-c.

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
@arthurscchan
arthurscchan force-pushed the msgpack-c-vrefbuffer-pack branch from 6239cea to ef5595d Compare November 20, 2026 07:37
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.96%. Comparing base (39cc081) to head (ef5595d).
⚠️ Report is 44 commits behind head on cpp_master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff               @@
##           cpp_master    #1215      +/-   ##
==============================================
- Coverage       85.36%   79.96%   -5.41%     
==============================================
  Files              80       80              
  Lines            5099     5824     +725     
  Branches          507      638     +131     
==============================================
+ Hits             4353     4657     +304     
- Misses            746     1167     +421     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@redboltz

Copy link
Copy Markdown
Contributor

Thank you. The issues shared by the four fuzzing PRs (dictionary format, duplicated corpora, the "report 20261108" references, CI compilation) are summarized in #1212, so I won't repeat them here. The dictionary format fix is required for this PR too.

Harness

The round-trip property (vrefbuffer bytes reassembled from vector() must equal a direct sbuffer pack and must unpack) is a good oracle. The harness builds with -std=c++11 plus libFuzzer/ASan/UBSan as the OSS-Fuzz build.sh does, all 26 seeds pass with -runs=0, and a short run found nothing.

Suggestion (non-blocking): exercise clear() on the migration destination

clear() is only ever called on buf, the migration source. The destination migrated is never cleared and re-packed. That is exactly the path of the heap overflow fixed recently in #1229 (migrate() into a destination, then clear() on the destination, then pack again), so this harness as written cannot catch a regression of that bug. Adding a branch like

if (ops & 4) {
    migrated.clear();
    msgpack::pack(migrated, obj);
    tail = &migrated;
}

(after the ops & 1 migration) would cover it.

Request

Please rebase this PR onto the current cpp_master (rebase, not merge) when you update it. cpp_master now includes #1229, which changed vrefbuffer::migrate(), so it is worth re-running the harness against the rebased tree as well.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants