]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Handle null values
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 12 Aug 2022 20:52:28 +0000 (21:52 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 12 Aug 2022 20:52:28 +0000 (21:52 +0100)
src/libserver/symcache/symcache_c.cxx

index 6ab1206c09f876dd409b453456857c6acc273fb9..bd1c1abc4e9b98db3a0ceb1a8743e97ee2e625fb 100644 (file)
@@ -106,6 +106,11 @@ rspamd_symcache_add_symbol_augmentation(struct rspamd_symcache *cache,
                return false;
        }
 
+       /* Handle empty or absent strings equally */
+       if (value == nullptr || value[0] == '\0') {
+               return item->add_augmentation(*real_cache, augmentation, std::nullopt);
+       }
+
        return item->add_augmentation(*real_cache, augmentation, value);
 }