From: Vsevolod Stakhov Date: Fri, 27 Sep 2019 14:05:16 +0000 (+0100) Subject: [Minor] Init tree before usage X-Git-Tag: 2.0~105 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0cde7b0683bf3f9550ad97bfdbedc22511c1505c;p=rspamd.git [Minor] Init tree before usage --- 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);