diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-12-18 16:05:45 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-12-18 16:07:19 +0000 |
commit | 21983194a05ca6cebfdd25c5bd750cd5c8aced17 (patch) | |
tree | 132cf55ed15f8f223dbf09e7b7ba3c156deb6995 /contrib/libucl/lua_ucl.c | |
parent | 10d2f9f5e95b3cea58ee359edfa00667d76facbf (diff) | |
download | rspamd-21983194a05ca6cebfdd25c5bd750cd5c8aced17.tar.gz rspamd-21983194a05ca6cebfdd25c5bd750cd5c8aced17.zip |
[Fix] Fix pushing ucl strings with \0 inside
Diffstat (limited to 'contrib/libucl/lua_ucl.c')
-rw-r--r-- | contrib/libucl/lua_ucl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/libucl/lua_ucl.c b/contrib/libucl/lua_ucl.c index 988dba355..4e5eb9452 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; |