commit 2198319: [Fix] Fix pushing ucl strings with \0 inside
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Dec 18 16:14:07 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-12-18 16:05:45 +0000
URL: https://github.com/rspamd/rspamd/commit/21983194a05ca6cebfdd25c5bd750cd5c8aced17
[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 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;
More information about the Commits
mailing list