]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Escape json strings for controller rejplies from Lua
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Apr 2017 10:11:31 +0000 (11:11 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Apr 2017 10:15:26 +0000 (11:15 +0100)
Issue: #1581

src/controller.c

index 71d21048f613d7b8c3c226ca8cb4acb0731fb688..9b18a1945432336bd792fa2932f7ac13b1054841 100644 (file)
@@ -3380,7 +3380,7 @@ static int
 lua_csession_send_ucl (lua_State *L)
 {
        struct rspamd_http_connection_entry *c = lua_check_controller_entry (L, 1);
-       ucl_object_t *obj = ucl_object_lua_import (L, 2);
+       ucl_object_t *obj = ucl_object_lua_import_escape (L, 2);
 
        if (c) {
                rspamd_controller_send_ucl (c, obj);
@@ -3520,7 +3520,7 @@ rspamd_controller_register_plugins_paths (struct rspamd_controller_worker_ctx *c
                        lua_gettable (L, -3); /* value is at -3 index */
 
                        if (lua_istable (L, -1)) {
-                               webui_data = ucl_object_lua_import (L, -1);
+                               webui_data = ucl_object_lua_import_escape (L, -1);
 
                                while ((cur = ucl_object_iterate (webui_data, &it, true)) != NULL) {
                                        handler_obj = ucl_object_lookup (cur, "handler");