From: Vsevolod Stakhov Date: Thu, 10 Oct 2019 10:15:25 +0000 (+0100) Subject: [Minor] Fix creation of the text from table X-Git-Tag: 2.0~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=614b48d55f1a4084fd4ef9de95603ba4334e6837;p=thirdparty%2Frspamd.git [Minor] Fix creation of the text from table --- diff --git a/src/lua/lua_text.c b/src/lua/lua_text.c index 63b1b22a8d..d02e1f5aa2 100644 --- a/src/lua/lua_text.c +++ b/src/lua/lua_text.c @@ -215,8 +215,11 @@ lua_text_fromtable (lua_State *L) } } + if (i != tblen - 1) { + textlen += dlen; + } + lua_pop (L, 1); - textlen += dlen; } /* Allocate new text */ @@ -243,7 +246,10 @@ lua_text_fromtable (lua_State *L) } } - memcpy (dest, delim, dlen); + if (i != tblen - 1) { + memcpy (dest, delim, dlen); + } + lua_pop (L, 1); }