From: Vsevolod Stakhov Date: Mon, 16 Nov 2020 18:45:17 +0000 (+0000) Subject: [Fix] Fix issue with pushing binary formats to Lua strings X-Git-Tag: 2.7~145 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0daf76ab882d2e2bda63a507e075ca05b59ee7f4;p=thirdparty%2Frspamd.git [Fix] Fix issue with pushing binary formats to Lua strings --- diff --git a/contrib/libucl/lua_ucl.c b/contrib/libucl/lua_ucl.c index fdffad7f1d..f552ce456b 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 {