Repository navigation
schema compile BUGFIX quote in a log path value - #2666
Open
Mohil-Ahuja wants to merge 1 commit into
Open
Mohil-Ahuja wants to merge 1 commit into
Mohil-Ahuja wants to merge 1 commit into
Conversation
A special tag value in the log path, such as the target of an augment, is quoted with ' and removing it skips the quoted part. A ' inside the value, as in augment "/c'x", unbalanced the quotes so the backwards scan went past the start of the path and read out of bounds. Quote the value with " if it includes ', only end a quoted part with its own quote character, and never scan before the start of the path.
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.
lysc_update_path()adds special tag values to the log path quoted with', for example/aq:{augment='/c/x'}. When the tag is removed again, the backwards scan skips quoted parts so that a=or{inside the value does not end the scan (7fddfaa). A'inside the value unbalances the quotes. The scan then never finds the=, and it runs past the start of the path.path_usedwraps around, and the read lands far outside the buffer.A module with an augment target such as
"/c'x"is enough. A release build crashes inlysc_update_path()called fromlys_precompile_mod_augments_deviations():The fix:
'is now quoted with".The test is added to
test_augmentintest_tree_schema_compile.c. I found this by fuzzinglys_parse_mem.