🐛 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:
parent
556e30f759
commit
8b457ace25
5 changed files with 21 additions and 6 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue