Reject nested indefinite-length CBOR string chunks - #5325
Conversation
| return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, | ||
| exception_message(input_format_t::cbor, concat("expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x", last_token), "string"), nullptr)); |
There was a problem hiding this comment.
This can yield confusing error messages like
expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x7F
Maybe we should rather have something like
concat("indefinite-length string is not allowed inside indefinite-length string; last byte: 0x", last_token)or just drop the or indefinite string type (0x7F).
|
Clang was updated and the latest develop branch fixes a CI issue. Please rebase to the latest develop branch. |
Signed-off-by: Joseph.Demarest <joseph@demarest.dev>
260510d to
e1ca730
Compare
|
Thanks — I rebased onto the current The affected C++11/C++17 multi-header tests and C++17 single-header tests pass locally. A clean bounded C++17 run also passed 86/86 tests, excluding the five exhaustive Unicode executables. |
Summary
Closes #5317.
Validation
ctest --test-dir build17 -j 8 -LE "not_reproducible|git_required" --output-on-failure— 77/77 passed (Clang 20, C++17)test-cbor_cpp17andtest-regression2_cpp17targets — passedsingle_include/nlohmann/json.hpp— both inputs raisedparse_error.113at byte 2git diff --check— cleanChecklist