YANG parser BUGFIX improve checking of input data when parsing
Despite the testcase is connected with special UTF8 character, it is
actually detected as unexpected end-of-input since the character starts
with a NULL-byte. In such a case libyang is not able to detect that
after the NULL-byte are still some data to read, it just interpret it as
end of input string.
Other, not-supported (by RFC) UTF8 characters should be detected
correctly with different error message.
Fixes #780
diff --git a/tests/src/test_xml.c b/tests/src/test_xml.c
index 671a1cf..22fc3e6 100644
--- a/tests/src/test_xml.c
+++ b/tests/src/test_xml.c
@@ -316,13 +316,13 @@
str = "";
assert_int_equal(LY_EVALID, lyxml_get_string(&ctx, &str, &buf, &buf_len, &out, &len, &dynamic));
assert_null(buf);
- logbuf_assert("Unexpected end-of-file. Line number 2.");
+ logbuf_assert("Unexpected end-of-input. Line number 2.");
ctx.status = LYXML_ELEM_CONTENT;
str = p = "xxx";
assert_int_equal(LY_EVALID, lyxml_get_string(&ctx, &str, &buf, &buf_len, &out, &len, &dynamic));
assert_null(buf);
- logbuf_assert("Unexpected end-of-file. Line number 2.");
+ logbuf_assert("Unexpected end-of-input. Line number 2.");
assert_ptr_equal(p, str); /* input data not eaten */
/* valid strings */