mirror of
https://github.com/nlohmann/json.git
synced 2026-10-06 14:40:32 +00:00
An image is a document stored so that loading it needs no
parsing: save() writes the node index, the text and the decoded
strings; the static load() reads an image written by save().
load() takes a pointer and size, a borrowed vector, or an owned
rvalue vector; the nodes are copied so they are aligned and can
be edited, while the text and decoded strings stay in the image.
image_check controls how much load() trusts the input: full
checks structure, bounds, strings and numbers, the parser's own
guarantees; bounds checks structure and bounds only; none skips
all checks, for images from a trusted source.
Layout is little-endian only ("NJVI" header, nodes, text, decoded
strings), following the idea of zero-copy formats such as
FlatBuffers and YaFF; the check follows FlatBuffers' Verifier.
New errors: parse_error.116 for a malformed image or a failed
check, type_error.320 for a discarded document or a big-endian
target.
A dedicated fuzzer and 6,000 seeded corruptions, checked under
ASan/UBSan, found and fixed two gaps: unchecked reserved header
fields, and unbounded null/boolean offsets that could make
dump() throw std::length_error.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
version: 1
|
|
|
|
labels:
|
|
- label: "documentation"
|
|
files:
|
|
- "README.md"
|
|
|
|
- label: "documentation"
|
|
files:
|
|
- "docs/.*"
|
|
|
|
- label: "tests"
|
|
files:
|
|
- "tests/.*"
|
|
|
|
- label: "CMake"
|
|
files:
|
|
- ".*CMakeLists.txt"
|
|
|
|
- label: "CMake"
|
|
files:
|
|
- "cmake/.*"
|
|
|
|
- label: "CI"
|
|
files:
|
|
- ".github/workflows/.*"
|
|
|
|
- label: "CI"
|
|
files:
|
|
- ".github/external_ci/.*"
|
|
|
|
- label: "CI"
|
|
files:
|
|
- ".github/(dependabot|labeler)\\.yml"
|
|
|
|
- label: "aspect: binary formats"
|
|
files:
|
|
- "include/nlohmann/detail/input/binary_reader\\.hpp"
|
|
- "include/nlohmann/detail/output/binary_writer\\.hpp"
|
|
- "tests/src/unit-(bson|cbor|msgpack|ubjson|bjdata|bon8|binary_formats)"
|
|
- "tests/src/fuzzer-parse_(bson|cbor|msgpack|ubjson|bjdata|bon8)"
|
|
- "docs/mkdocs/docs/features/binary_formats/"
|
|
- "docs/mkdocs/docs/(api/basic_json|examples)/(to|from)_(bson|cbor|msgpack|ubjson|bjdata|bon8)"
|
|
|
|
- label: "aspect: binary formats"
|
|
title: "(?i)(bson|cbor|msgpack|messagepack|ubjson|bjdata|bon8|binary format)"
|
|
|
|
- label: "aspect: json_view"
|
|
files:
|
|
- "include/nlohmann/json_view\\.hpp"
|
|
- "include/nlohmann/detail/view/.*"
|
|
- "single_include/nlohmann/json_view\\.hpp"
|
|
- "tests/src/unit-json_view.*"
|
|
- "tests/src/fuzzer-(parse_json_view|json_view_image)\\.cpp"
|
|
- "tools/amalgamate/config_json_view\\.json"
|
|
- "docs/mkdocs/docs/features/json_view\\.md"
|
|
- "docs/mkdocs/docs/api/basic_json_(document|view)/.*"
|
|
- "docs/mkdocs/docs/api/(ordered_)?json_(editable_)?(document|view)\\.md"
|
|
- "docs/mkdocs/docs/examples/(basic_json_(document|view)__|(ordered_)?json_(editable_)?(document|view)).*"
|
|
- "tests/benchmarks/src/benchmarks_view\\.cpp"
|
|
|
|
- label: "aspect: json_view"
|
|
title: "(?i)(json_view|json_document|zero-copy)"
|
|
|
|
- label: "python"
|
|
files:
|
|
- "\\.py$"
|
|
- "requirements[^/]*\\.txt$"
|
|
|
|
- label: "S"
|
|
size-below: 10
|
|
- label: "M"
|
|
size-above: 9
|
|
size-below: 100
|
|
- label: "L"
|
|
size-above: 100
|