From: Vsevolod Stakhov Date: Fri, 18 Dec 2020 16:05:45 +0000 (+0000) Subject: [Fix] Fix pushing ucl strings with \0 inside X-Git-Tag: 2.7~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=21983194a05ca6cebfdd25c5bd750cd5c8aced17;p=thirdparty%2Frspamd.git [Fix] Fix pushing ucl strings with \0 inside --- diff --git a/contrib/libucl/lua_ucl.c b/contrib/libucl/lua_ucl.c index 988dba355b..4e5eb9452b 100644 --- a/contrib/libucl/lua_ucl.c +++ b/contrib/libucl/lua_ucl.c @@ -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;