aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-10 11:15:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-10 11:15:25 +0100
commit614b48d55f1a4084fd4ef9de95603ba4334e6837 (patch)
tree2ea25df7c1f2a323dd7366ef36184329e690d754
parent1bf202d540865ebd8d4e5f0d21e067eff3102def (diff)
downloadrspamd-614b48d55f1a4084fd4ef9de95603ba4334e6837.tar.gz
rspamd-614b48d55f1a4084fd4ef9de95603ba4334e6837.zip
[Minor] Fix creation of the text from table
-rw-r--r--src/lua/lua_text.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lua/lua_text.c b/src/lua/lua_text.c
index 63b1b22a8..d02e1f5aa 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);
}