summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorportix <none@none>2013-02-01 01:14:41 +0100
committerportix <none@none>2013-02-01 01:14:41 +0100
commit3182ab0b97f621f4e4fd5a4f56e8d7400a995ccd (patch)
treec8891b1de5f588331056a321d18fa95d67f1aa7c /src/util.c
parent876f8dbffea7286078d3548af49031a8c4e20d8a (diff)
downloaddwb-3182ab0b97f621f4e4fd5a4f56e8d7400a995ccd.zip
Escape all characters that must be escaped in util_create_json, additional argument-parameter in commands_simple_command
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index e2afe993..4335133d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -773,7 +773,14 @@ util_create_json(int n, ...) {
else {
g_string_append_c(string, '"');
while (*cval) {
- if (*cval == '"')
+ if ( *cval == '"'
+ || *cval == '/'
+ || *cval == '\\'
+ || *cval == '\b'
+ || *cval == '\f'
+ || *cval == '\n'
+ || *cval == '\r'
+ || *cval == '\t')
g_string_append_c(string, '\\');
g_string_append_c(string, *cval);
cval++;