Repository navigation
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## cpp_master #1239 +/- ##
==============================================
- Coverage 85.36% 80.40% -4.97%
==============================================
Files 80 80
Lines 5099 5859 +760
Branches 507 656 +149
==============================================
+ Hits 4353 4711 +358
- Misses 746 1148 +402 🚀 New features to boost your workflow:
|
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.
64473c2 fixed the null data pointer of an empty str or bin reaching memcpy and memcmp in
object.hpp's copy and equality visitors, but the v1 adaptors still pass it through.a0(fixstr, length 0) decodes tovia.str.ptr == MSGPACK_NULLPTR, so comparing twov4raw_refvalues calls memcmp with null arguments, and converting an empty str or bin intochar[N],unsigned char[N],std::array<char, N>,std::array<unsigned char, N>orstd::byte[N]calls memcpy with a null source. WithMSGPACK_DEFAULT_API_VERSION=1the v1unpack_str/unpack_binreport every zero-length str and bin that way, so the bin branches are reachable too; glibc declares both functions__nonnull((1,2))and the CI job builds with-fno-sanitize-recover=all, so a test that walked these paths aborts the build rather than just warning.The guard sits next to each call, in the form
raw_refand thevector_char/vector_unsigned_char/vector_byteadaptors already use, so callers don't each need to special case an empty payload before converting or comparing. Non-empty payloads are untouched: the length is still checked againstNfirst and the trailing NUL is still written whensize < N. The two new cases intest/security_fixes_cpp11.cppabort under UBSan on the current tree (null pointer passed as argument 2, which is declared to never be nullatcarray.hpp:50) and pass with the fix; the full suite stays green (42/42) at API versions 1 and 3 with-Werror -g -fsanitize=undefined -fno-sanitize-recover=all.