Skip to content

Unicode Specials block bug#2510

Merged
michalvasko merged 3 commits intoCESNET:develfrom
nokia:unicode_block_range_bug
Apr 14, 2026
Merged

Unicode Specials block bug#2510
michalvasko merged 3 commits intoCESNET:develfrom
nokia:unicode_block_range_bug

Conversation

@manoe
Copy link
Copy Markdown

@manoe manoe commented Apr 13, 2026

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.

@michalvasko
Copy link
Copy Markdown
Member

Okay, thanks, seems this should be fixed but no need to add the length into the struct, a few strlen() calls do not make any difference so please adjust it.

@manoe
Copy link
Copy Markdown
Author

manoe commented Apr 13, 2026

CIFuzz keeps failing, however, based on the logs I cannot tell what went wrong. Can I get a little bit help with fuzzing?

@manoe
Copy link
Copy Markdown
Author

manoe commented Apr 14, 2026

I've rebased my branch/PR to devel, but the CIFuzz keeps failing. Apparently, the binary exits Failed to create context. Could you take a look whats wrong? I would appreciate your input.

@michalvasko
Copy link
Copy Markdown
Member

Never mind the fuzz test, its failures are caused by recent changes of mine but please correctly rebase your branch to devel, my commits must not be part of your PR.

@manoe manoe force-pushed the unicode_block_range_bug branch from add202c to 5d96d71 Compare April 14, 2026 07:17
@manoe manoe force-pushed the unicode_block_range_bug branch from 5d96d71 to 2b41eda Compare April 14, 2026 07:28
@manoe
Copy link
Copy Markdown
Author

manoe commented Apr 14, 2026

Hi, I managed (with much help) to remove your commits from my PR.

@michalvasko michalvasko merged commit 931b7b8 into CESNET:devel Apr 14, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants