From 56ddcb65f018e06709472fa8b962cc60195e6d56 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 27 Sep 2026 20:40:13 +0200 Subject: [PATCH 1/3] Fix documentation style check: wrap long line in cbor_tag_handler_t.md (#5603) The line added in #5559 exceeded the 160-character limit enforced by docs/mkdocs/scripts/check_structure.py, breaking the documentation build. Signed-off-by: Niels Lohmann --- docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md b/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md index cea009e4e..28bd99535 100644 --- a/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md +++ b/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md @@ -18,7 +18,8 @@ ignore : ignore tags store -: store tagged byte strings (for bytes 0xd8..0xdb) as binary values with the tag as subtype; other tagged values are read as if the tag were ignored. If several tags precede a byte string, only the innermost one is stored. +: store tagged byte strings (for bytes 0xd8..0xdb) as binary values with the tag as subtype; other tagged values are + read as if the tag were ignored. If several tags precede a byte string, only the innermost one is stored. ## Examples From de6acd651ec5c6849b6b4460abd031f6fbcc42fd Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 27 Sep 2026 20:40:33 +0200 Subject: [PATCH 2/3] Fix CI: wrap an overlong line in the cbor_tag_handler_t documentation (#5602) #5559 added a 224-character line to cbor_tag_handler_t.md; the documentation style check allows at most 160. Signed-off-by: Niels Lohmann From 373005f7accebb2eff11d2837c468094e3116b38 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 27 Sep 2026 20:57:16 +0200 Subject: [PATCH 3/3] Fix MSVC: avoid reserving by faked size in MessagePack size tests (#5604) The "Size above uint32" tests for arrays and objects fake a container size of 2^32 and expect to_msgpack() to throw out_of_range.412. But to_msgpack(j) first reserves binary_reserve_hint(j) bytes, which is size + 1 for arrays and 2 * size + 1 for objects, i.e. 4 or 8 GiB. Linux and macOS overcommit, so the reservation succeeds; on Windows it throws std::bad_alloc before the size check is reached (seen with msvc-vs2026 Debug x64 on the object test). Write into a caller-owned vector instead, so nothing is reserved. Signed-off-by: Niels Lohmann --- tests/src/unit-msgpack.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/src/unit-msgpack.cpp b/tests/src/unit-msgpack.cpp index 077073052..de4255b4a 100644 --- a/tests/src/unit-msgpack.cpp +++ b/tests/src/unit-msgpack.cpp @@ -2208,8 +2208,11 @@ TEST_CASE("MessagePack Size above uint32 for array") auto& array = j.get_ref(); array.fake_size = true; + // write into a caller-owned vector: to_msgpack(j) reserves space based on + // the (faked) element count, which fails with bad_alloc on Windows + std::vector result; CHECK_THROWS_WITH_AS( - huge_array_json::to_msgpack(j), + huge_array_json::to_msgpack(j, result), "[json.exception.out_of_range.412] MessagePack length 4294967296 exceeds maximum of 4294967295", json::out_of_range&); @@ -2261,8 +2264,11 @@ TEST_CASE("MessagePack Size above uint32 for object") auto& object = j.get_ref(); object.fake_size = true; + // write into a caller-owned vector: to_msgpack(j) reserves space based on + // the (faked) element count, which fails with bad_alloc on Windows + std::vector result; CHECK_THROWS_WITH_AS( - huge_object_json::to_msgpack(j), + huge_object_json::to_msgpack(j, result), "[json.exception.out_of_range.412] MessagePack length 4294967296 exceeds maximum of 4294967295", json::out_of_range&);