mirror of
https://github.com/nlohmann/json.git
synced 2026-02-09 23:52:15 +00:00
🐛 fixing CBOR's indefinity length strings #961
Beside the fix discussed in #961, we also had to re-adjust a test case. It seems that it was failing before, and I "fixed" it to work with the broken implementation...
This commit is contained in:
@@ -1408,4 +1408,19 @@ TEST_CASE("regression tests")
|
||||
"path": "/a/b/c"}])"_json),
|
||||
"[json.exception.out_of_range.403] key 'a' not found");
|
||||
}
|
||||
|
||||
SECTION("issue #961 - incorrect parsing of indefinite length CBOR strings")
|
||||
{
|
||||
std::vector<uint8_t> v_cbor =
|
||||
{
|
||||
0x7F,
|
||||
0x64,
|
||||
'a', 'b', 'c', 'd',
|
||||
0x63,
|
||||
'1', '2', '3',
|
||||
0xFF
|
||||
};
|
||||
json j = json::from_cbor(v_cbor);
|
||||
CHECK(j == "abcd123");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user