diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-29 13:57:41 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-29 13:57:41 +0100 |
commit | 626c7a170f73eb17efb084be49da3b30fe773a61 (patch) | |
tree | e019bf085b04440eca98b836e26f4dce73ae8091 /contrib/libucl | |
parent | 2a59b34f18c5749a504ca588d6ca91b8c2af829f (diff) | |
download | rspamd-626c7a170f73eb17efb084be49da3b30fe773a61.tar.gz rspamd-626c7a170f73eb17efb084be49da3b30fe773a61.zip |
[Fix] Fix processing of '\v' in libucl
Issue: #2045
Diffstat (limited to 'contrib/libucl')
-rw-r--r-- | contrib/libucl/ucl_emitter_utils.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/libucl/ucl_emitter_utils.c b/contrib/libucl/ucl_emitter_utils.c index 04940a902..11a6c4b3d 100644 --- a/contrib/libucl/ucl_emitter_utils.c +++ b/contrib/libucl/ucl_emitter_utils.c @@ -102,7 +102,9 @@ ucl_elt_string_write_json (const char *str, size_t size, func->ucl_emitter_append_character ('"', 1, func->ud); while (size) { - if (ucl_test_character (*p, UCL_CHARACTER_JSON_UNSAFE|UCL_CHARACTER_DENIED)) { + if (ucl_test_character (*p, (UCL_CHARACTER_JSON_UNSAFE| + UCL_CHARACTER_DENIED| + UCL_CHARACTER_WHITESPACE_UNSAFE))) { if (len > 0) { func->ucl_emitter_append_len (c, len, func->ud); } @@ -122,9 +124,15 @@ ucl_elt_string_write_json (const char *str, size_t size, case '\f': func->ucl_emitter_append_len ("\\f", 2, func->ud); break; + case '\v': + func->ucl_emitter_append_len ("\\v", 2, func->ud); + break; case '\\': func->ucl_emitter_append_len ("\\\\", 2, func->ud); break; + case ' ': + func->ucl_emitter_append_character (' ', 1, func->ud); + break; case '"': func->ucl_emitter_append_len ("\\\"", 2, func->ud); break; |