]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix pushing ucl strings with \0 inside
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 Dec 2020 16:05:45 +0000 (16:05 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 Dec 2020 16:07:19 +0000 (16:07 +0000)
contrib/libucl/lua_ucl.c

index 988dba355b42bc4fa4d72e81beff816117208ed4..4e5eb9452b286e029a8965deaa84ab56088b74cf 100644 (file)
@@ -240,7 +240,7 @@ ucl_object_lua_push_scalar (lua_State *L, const ucl_object_t *obj,
                lua_pushboolean (L, ucl_obj_toboolean (obj));
                break;
        case UCL_STRING:
-               lua_pushstring (L, ucl_obj_tostring (obj));
+               lua_pushlstring (L, ucl_obj_tostring (obj), obj->len);
                break;
        case UCL_INT:
 #if LUA_VERSION_NUM >= 501
@@ -862,7 +862,7 @@ lua_ucl_parser_parse_text (lua_State *L)
        else {
                const gchar *s;
                gsize len;
-               struct _rspamd_lua_text st_t;
+               static struct _rspamd_lua_text st_t;
 
                s = lua_tolstring (L, 2, &len);
                st_t.start = s;