diff options
author | Ronny Chevalier <chevalier.ronny@gmail.com> | 2017-05-14 13:19:11 +0200 |
---|---|---|
committer | Ronny Chevalier <chevalier.ronny@gmail.com> | 2017-05-14 13:19:11 +0200 |
commit | b4958f42af08a72cf02e845c8db8d60fe2e5a82f (patch) | |
tree | fc3c855f88a50d5863579b7695460e7ebd51c955 /src/test/test-conf-parser.c | |
parent | 0839f42ebfbe27cb0de2a618197bbd4bd6d5a6f8 (diff) | |
download | systemd-b4958f42af08a72cf02e845c8db8d60fe2e5a82f.tar.gz |
conf-parser: fix wrong argument given to log_syntax_invalid_utf8
The condition is on "word", hence we give word instead of rvalue.
An assert would be triggered if !utf8_is_valid(word) is true and
rvalue == NULL, since log_syntax_invalid_utf8 calls utf8_escape_invalid
which calls assert(str).
A test case has been added to test with valid and invalid utf8.
Diffstat (limited to 'src/test/test-conf-parser.c')
-rw-r--r-- | src/test/test-conf-parser.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c index be5d2611f8..26ff27035b 100644 --- a/src/test/test-conf-parser.c +++ b/src/test/test-conf-parser.c @@ -180,6 +180,8 @@ static void test_config_parse_strv(void) { test_config_parse_strv_one("foo", STRV_MAKE("foo")); test_config_parse_strv_one("foo bar foo", STRV_MAKE("foo", "bar", "foo")); test_config_parse_strv_one("\"foo bar\" foo", STRV_MAKE("foo bar", "foo")); + test_config_parse_strv_one("\xc3\x80", STRV_MAKE("\xc3\x80")); + test_config_parse_strv_one("\xc3\x7f", STRV_MAKE_EMPTY); } static void test_config_parse_mode(void) { |