diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-01 16:23:46 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-01 16:23:46 +0100 |
commit | 32fb22038f15cf4b42f63e310ec662d0fa94aa3a (patch) | |
tree | c965ee3b749c5bcdd1972203e2be894c449155d5 | |
parent | ec26b2891d5fed2a27e294634197fa0b173b46a5 (diff) | |
download | rspamd-32fb22038f15cf4b42f63e310ec662d0fa94aa3a.tar.gz rspamd-32fb22038f15cf4b42f63e310ec662d0fa94aa3a.zip |
Zero ip->addr structure field to avoid corruption.
-rw-r--r-- | src/lua/lua_ip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/lua_ip.c b/src/lua/lua_ip.c index a43cbca66..452e45f14 100644 --- a/src/lua/lua_ip.c +++ b/src/lua/lua_ip.c @@ -494,7 +494,7 @@ rspamd_lua_ip_push (lua_State *L, rspamd_inet_addr_t *addr) { struct rspamd_lua_ip *ip, **pip; - ip = g_slice_alloc (sizeof (struct rspamd_lua_ip)); + ip = g_slice_alloc0 (sizeof (struct rspamd_lua_ip)); ip->addr = rspamd_inet_address_copy (addr); pip = lua_newuserdata (L, sizeof (struct rspamd_lua_ip *)); rspamd_lua_setclass (L, "rspamd{ip}", -1); @@ -510,7 +510,7 @@ rspamd_lua_ip_push_fromstring (lua_State *L, const gchar *ip_str) lua_pushnil (L); } else { - ip = g_slice_alloc (sizeof (struct rspamd_lua_ip)); + ip = g_slice_alloc0 (sizeof (struct rspamd_lua_ip)); rspamd_parse_inet_address (&ip->addr, ip_str); pip = lua_newuserdata (L, sizeof (struct rspamd_lua_ip *)); |