]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add a small protection against bad characters in symbols
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jan 2021 14:44:06 +0000 (14:44 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jan 2021 14:44:06 +0000 (14:44 +0000)
src/libserver/rspamd_symcache.c

index fedd2cf029dbef9df6965959332cdade295c3e6c..1b02b62a8d9e68f4c94d43b7429b90d219b962d3 100644 (file)
@@ -1056,6 +1056,11 @@ rspamd_symcache_add_symbol (struct rspamd_symcache *cache,
        if (name != NULL && !(type & SYMBOL_TYPE_CALLBACK)) {
                struct rspamd_symcache_item *existing;
 
+               if (strcspn (name, " \t\n\r") != strlen (name)) {
+                       msg_warn_cache ("bogus characters in symbol name: \"%s\"",
+                                       name);
+               }
+
                if ((existing = g_hash_table_lookup (cache->items_by_symbol, name)) != NULL) {
 
                        if (existing->type & SYMBOL_TYPE_GHOST) {