commit 0cde7b0: [Minor] Init tree before usage

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Sep 27 14:35:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-09-27 15:05:16 +0100
URL: https://github.com/rspamd/rspamd/commit/0cde7b0683bf3f9550ad97bfdbedc22511c1505c

[Minor] Init tree before usage

---
 contrib/lua-lpeg/lptree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/lua-lpeg/lptree.c b/contrib/lua-lpeg/lptree.c
index 7a91931bf..cb8342459 100644
--- a/contrib/lua-lpeg/lptree.c
+++ b/contrib/lua-lpeg/lptree.c
@@ -358,6 +358,7 @@ static TTree *gettree (lua_State *L, int idx, int *len) {
 static TTree *newtree (lua_State *L, int len) {
   size_t size = (len - 1) * sizeof(TTree) + sizeof(Pattern);
   Pattern *p = (Pattern *)lua_newuserdata(L, size);
+  memset(p, 0, size);
   luaL_getmetatable(L, PATTERN_T);
   lua_pushvalue(L, -1);
   lua_setuservalue(L, -3);


More information about the Commits mailing list