summaryrefslogtreecommitdiffstats
path: root/contrib/libucl/lua_ucl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-16 18:45:17 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-16 18:45:58 +0000
commit0daf76ab882d2e2bda63a507e075ca05b59ee7f4 (patch)
tree2600ef83a05902051feccbad74b5298920536571 /contrib/libucl/lua_ucl.c
parent866c94c4c97be46e195c62a3433ec25ee0f41160 (diff)
downloadrspamd-0daf76ab882d2e2bda63a507e075ca05b59ee7f4.tar.gz
rspamd-0daf76ab882d2e2bda63a507e075ca05b59ee7f4.zip
[Fix] Fix issue with pushing binary formats to Lua strings
Diffstat (limited to 'contrib/libucl/lua_ucl.c')
-rw-r--r--contrib/libucl/lua_ucl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/libucl/lua_ucl.c b/contrib/libucl/lua_ucl.c
index fdffad7f1..f552ce456 100644
--- a/contrib/libucl/lua_ucl.c
+++ b/contrib/libucl/lua_ucl.c
@@ -598,11 +598,12 @@ static int
lua_ucl_to_string (lua_State *L, const ucl_object_t *obj, enum ucl_emitter type)
{
unsigned char *result;
+ size_t outlen;
- result = ucl_object_emit (obj, type);
+ result = ucl_object_emit_len (obj, type, &outlen);
if (result != NULL) {
- lua_pushstring (L, (const char *)result);
+ lua_pushlstring (L, (const char *)result, outlen);
free (result);
}
else {