Open
Conversation
Member
|
Okay, thanks, seems this should be fixed but no need to add the length into the struct, a few |
michalvasko
approved these changes
Apr 13, 2026
Author
|
CIFuzz keeps failing, however, based on the logs I cannot tell what went wrong. Can I get a little bit help with fuzzing? |
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.
Libyang/yanglint cannot match characters of Unicode Specials block.
The function ly_pat_compile_xmlschema_chblocks_xmlschema2perl() responsible to translate Yang patterns containing Unicode blocks to PCRE2-compatible Perl-based regular expressions with character ranges assumes that each range literal is 19 char long. However, the Specials Unicode block is "special". It contains the disjoint U+FEFF character, and the range U+FFF0-U+FFFD. The original implementation only copies the first 19 chars of the literal, that is \x{FEFF}|\x{FFF0}. The expression is valid unfortunately, however only matches U+FEFF and U+FFF0.
The correction changes the ublock2urange two dimensional char array to a struct array, which is populated during compilation time also with the individual literal lengths to preserve performance (assuming, that the original intention for hard-coding URANGE_LEN was to avoid strlen calls).
Corresponding unit and component tests are also submitted.