commit 72d9ed6: [Minor] Fix userdata storage

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Feb 21 15:42:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-02-21 15:36:57 +0000
URL: https://github.com/rspamd/rspamd/commit/72d9ed6d599a41f430fde499ade11ae755a08540 (HEAD -> master)

[Minor] Fix userdata storage

---
 src/libserver/rspamd_symcache.c | 2 ++
 src/lua/lua_config.c            | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c
index 615c7cdf6..3cfb15408 100644
--- a/src/libserver/rspamd_symcache.c
+++ b/src/libserver/rspamd_symcache.c
@@ -931,6 +931,8 @@ rspamd_symcache_add_symbol (struct rspamd_symcache *cache,
 		 */
 		if (item->type & SYMBOL_TYPE_COMPOSITE) {
 			item->specific.normal.condition_cb = -1;
+			item->specific.normal.user_data = user_data;
+			g_assert (user_data != NULL);
 			g_ptr_array_add (cache->composites, item);
 
 			item->id = cache->items_by_id->len;
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index a41ffa63f..147e4ff80 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -2431,7 +2431,7 @@ lua_config_add_composite (lua_State * L)
 
 				if (new) {
 					rspamd_symcache_add_symbol (cfg->cache, name,
-							0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
+							0, NULL, composite, SYMBOL_TYPE_COMPOSITE, -1);
 				}
 
 				ret = TRUE;


More information about the Commits mailing list