Repository navigation
Guard rfl::yaml::Reader against recursive aliases and out-of-bounds literal marks - #41
Closed
clockblocker wants to merge 1 commit into
Closed
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
…iteral marks Track ancestor YAML nodes via a thread-local RAII guard (ActiveNodeGuard in src/rfl/yaml/Reader.cpp) across read_object and read_array so cyclic YAML aliases return an rfl::Error instead of overflowing the stack, while keeping const Reader instances thread-safe and allowing non-cyclic (DAG) alias reuse. Also bounds-check YAML::Mark::pos before indexing yaml_str_ when trimming trailing newlines on literal block scalars.
This was referenced Nov 25, 2026
Owner
Author
|
Combined with #42 (2 semantic commits off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 5 (split from #40).
Summary
Reader::ActiveNodeGuardinsrc/rfl/yaml/Reader.cpp) used byread_objectandread_arrayso cyclic YAML aliases return anrfl::Errorinstead of overflowing the stack.const rfl::yaml::Readerstateless and thread-safe while still allowing non-cyclic (DAG) alias reuse.YAML::Mark::posbefore indexingyaml_str_when trimming trailing newlines on literal block scalars.tests/yaml/test_recursive_alias.cpp.Verification
reflect-cpp-yaml-tests(68/68 at this commit; 630/630 full suite and 85/85 shared-library hidden-visibility tests at stack top) plus C++20/C++23 self-contained header checks.