config: assert that strings are valid UTF-8
This commit is contained in:
parent
c4ea0e28fd
commit
409a13ac7f
2
common.c
2
common.c
@ -664,6 +664,8 @@ config_item_string (const struct str *s)
|
||||
{
|
||||
struct config_item_ *self = config_item_new (CONFIG_ITEM_STRING);
|
||||
str_init (&self->value.string);
|
||||
hard_assert (utf8_validate
|
||||
(self->value.string.str, self->value.string.len));
|
||||
if (s) str_append_str (&self->value.string, s);
|
||||
return self;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user