aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-05-02 15:06:31 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-05-02 15:06:31 +0200
commit409a13ac7f6b0d810affc9a07ac80d55d85d21d7 (patch)
tree5ec298e23c932ac433a3c4fe744425709c148ec4
parentc4ea0e28fdc3b1be8c8f69f816acabfbe007dc79 (diff)
downloadxK-409a13ac7f6b0d810affc9a07ac80d55d85d21d7.tar.gz
xK-409a13ac7f6b0d810affc9a07ac80d55d85d21d7.tar.xz
xK-409a13ac7f6b0d810affc9a07ac80d55d85d21d7.zip
config: assert that strings are valid UTF-8
-rw-r--r--common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common.c b/common.c
index 7bfe9fe..03c6356 100644
--- a/common.c
+++ b/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;
}