diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-01-04 14:44:06 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-01-04 14:44:06 +0000 |
commit | fe2a739af4ad2bce76600e7386fc0ad12c3da354 (patch) | |
tree | 24f35c9b4a726ed847629c32defd863b08c42e45 /src/libserver/rspamd_symcache.c | |
parent | 183ae244a5e3fc79550d4753f2430e81a80c1bcf (diff) | |
download | rspamd-fe2a739af4ad2bce76600e7386fc0ad12c3da354.tar.gz rspamd-fe2a739af4ad2bce76600e7386fc0ad12c3da354.zip |
[Minor] Add a small protection against bad characters in symbols
Diffstat (limited to 'src/libserver/rspamd_symcache.c')
-rw-r--r-- | src/libserver/rspamd_symcache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c index fedd2cf02..1b02b62a8 100644 --- a/src/libserver/rspamd_symcache.c +++ b/src/libserver/rspamd_symcache.c @@ -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) { |