schema helpers BUGFIX added isprint protection
The standards require that the argument for isprint function is either
EOF or a value that is representable in the type unsigned char.
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 7832354..64f8945 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -843,7 +843,7 @@
{
if (first || (prefix && ((*prefix) == 1))) {
if (!is_yangidentstartchar(c)) {
- if (isprint(c)) {
+ if ((c < UCHAR_MAX) && isprint(c)) {
LOGVAL_PARSER(ctx, LYVE_SYNTAX_YANG, "Invalid identifier first character '%c' (0x%04x).", (char)c, c);
} else {
LOGVAL_PARSER(ctx, LYVE_SYNTAX_YANG, "Invalid identifier first character 0x%04x.", c);
diff --git a/tests/fuzz/corpus/lys_parse_mem/pull1568.yang b/tests/fuzz/corpus/lys_parse_mem/pull1568.yang
new file mode 100644
index 0000000..29b6c2d
--- /dev/null
+++ b/tests/fuzz/corpus/lys_parse_mem/pull1568.yang
@@ -0,0 +1,4 @@
+module
+f{grouping
+s{list
+ym{
\ No newline at end of file