Skip to content

OSS-Fuzz: Add new fuzzer/corpus/dict targets object conversion - #1213

Open
arthurscchan wants to merge 1 commit into
msgpack:cpp_masterfrom
arthurscchan:msgpack-c-object-convert
Open

arthurscchan wants to merge 1 commit into
msgpack:cpp_masterfrom
arthurscchan:msgpack-c-object-convert

Conversation

@arthurscchan

Copy link
Copy Markdown

This PR adds a new OSS-Fuzz fuzzer with corpus/dict targets object conversion, 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-object-convert branch from bfe23f4 to 5157c39 Compare November 20, 2026 07:36
@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 (5157c39).
⚠️ 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    #1213      +/-   ##
==============================================
- 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.

This harness found a real library bug (already fixed on cpp_master)

Running object_convert_fuzzer for about 30 seconds under UBSan reported:

include/msgpack/v1/object.hpp:733:30: runtime error: null pointer passed as argument 2, which is declared to never be null

An empty str decoded from the wire (a0, one byte) has via.str.ptr == NULL, and the zone deep copy msgpack::object(o, zone) called memcpy(ptr, NULL, 0). Comparing such an object called memcmp with a null pointer as well. Minimal reproducer:

msgpack::object_handle oh = msgpack::unpack("\xa0", 1);
msgpack::zone z;
msgpack::object c(oh.get(), z);   // UBSan: null pointer passed to memcpy

This is fixed in #1231 (merged into cpp_master), with regression tests. Without that fix the OSS-Fuzz UBSan build would report this crash as soon as this harness is enabled, so please rebase this PR onto the current cpp_master (rebase, not merge) before updating it. With the fix, replaying the crash artifact is clean and a further 30 s run found nothing new.

Harness

No problems found in the harness itself. It builds with -std=c++11 plus libFuzzer/ASan/UBSan as the OSS-Fuzz build.sh does (the only warning is -Wunused-but-set-variable on the static volatile sink), and all 26 seeds pass with -runs=0.

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