conf-parser: fix wrong argument given to log_syntax_invalid_utf8
authorRonny Chevalier <chevalier.ronny@gmail.com>
Sun, 14 May 2017 11:19:11 +0000 (13:19 +0200)
committerRonny Chevalier <chevalier.ronny@gmail.com>
Sun, 14 May 2017 11:19:11 +0000 (13:19 +0200)
commitb4958f42af08a72cf02e845c8db8d60fe2e5a82f
treefc3c855f88a50d5863579b7695460e7ebd51c955
parent0839f42ebfbe27cb0de2a618197bbd4bd6d5a6f8
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.
src/shared/conf-parser.c
src/test/test-conf-parser.c