From 21983194a05ca6cebfdd25c5bd750cd5c8aced17 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 18 Dec 2020 16:05:45 +0000 Subject: [PATCH] [Fix] Fix pushing ucl strings with \0 inside --- contrib/libucl/lua_ucl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.3