commit 4e9e252: [Minor] Fix crash on non resolving virtual dependency

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Dec 28 21:14:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-12-28 21:07:45 +0000
URL: https://github.com/rspamd/rspamd/commit/4e9e25230c63574c9a37c4d621a3a5c215d94e2e

[Minor] Fix crash on non resolving virtual dependency

---
 src/libserver/rspamd_symcache.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c
index ecafae892..fedd2cf02 100644
--- a/src/libserver/rspamd_symcache.c
+++ b/src/libserver/rspamd_symcache.c
@@ -586,8 +586,15 @@ rspamd_symcache_process_dep (struct rspamd_symcache *cache,
 	if (dep->vid >= 0) {
 		/* Case of the virtual symbol that depends on another (maybe virtual) symbol */
 		vdit = rspamd_symcache_find_filter (cache, dep->sym, false);
-		msg_debug_cache ("process virtual dependency %s(%d) on %s(%d)", it->symbol,
-				dep->vid, vdit->symbol, vdit->id);
+
+		if (!vdit) {
+			msg_err_cache ("cannot add dependency from %s on %s: no dependency symbol registered",
+					dep->sym, dit->symbol);
+		}
+		else {
+			msg_debug_cache ("process virtual dependency %s(%d) on %s(%d)", it->symbol,
+					dep->vid, vdit->symbol, vdit->id);
+		}
 	}
 	else {
 		vdit = dit;


More information about the Commits mailing list