commit d20c466: [Minor] Fix various settings issues

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jun 17 11:21:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-17 12:16:29 +0100
URL: https://github.com/rspamd/rspamd/commit/d20c466cd2d98a5f8abb9bdb9c85902b258cc563 (HEAD -> master)

[Minor] Fix various settings issues

---
 src/libserver/rspamd_symcache.c | 6 ++++--
 src/lua/lua_common.c            | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c
index 3560957af..5a4a002c3 100644
--- a/src/libserver/rspamd_symcache.c
+++ b/src/libserver/rspamd_symcache.c
@@ -3203,7 +3203,8 @@ rspamd_symcache_add_id_to_list (rspamd_mempool_t *pool,
 			g_assert (ls->dyn.allocated <= G_MAXINT16);
 			ls->dyn.allocated *= 2;
 
-			new_array = rspamd_mempool_alloc (pool, ls->dyn.allocated);
+			new_array = rspamd_mempool_alloc (pool,
+					ls->dyn.allocated * sizeof (guint32));
 			memcpy (new_array, ls->dyn.n, ls->dyn.len * sizeof (guint32));
 			ls->dyn.n = new_array;
 			ls->dyn.n[ls->dyn.len++] = id;
@@ -3222,7 +3223,8 @@ rspamd_symcache_add_id_to_list (rspamd_mempool_t *pool,
 		}
 		else {
 			/* Switch to dynamic */
-			new_array = rspamd_mempool_alloc (pool, G_N_ELEMENTS (ls->st) * 2);
+			new_array = rspamd_mempool_alloc (pool,
+					G_N_ELEMENTS (ls->st) * 2 * sizeof (guint32));
 			memcpy (new_array, ls->st,  G_N_ELEMENTS (ls->st) * sizeof (guint32));
 			ls->dyn.n = new_array;
 			ls->dyn.e = -1;
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index a912fb5b5..7e7a2854f 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -1902,7 +1902,7 @@ rspamd_lua_run_config_unload (lua_State *L, struct rspamd_config *cfg)
 	struct rspamd_config_cfg_lua_script *sc;
 	struct rspamd_config **pcfg;
 
-	LL_FOREACH (cfg->post_init_scripts, sc) {
+	LL_FOREACH (cfg->config_unload_scripts, sc) {
 		lua_pushcfunction (L, &rspamd_lua_traceback);
 		gint err_idx = lua_gettop (L);
 


More information about the Commits mailing list