From: Vsevolod Stakhov Date: Fri, 12 Aug 2022 20:52:28 +0000 (+0100) Subject: [Minor] Handle null values X-Git-Tag: 3.3~78 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1e7d04a8a1e9f7b3d246f01a131a3edc8fa81682;p=rspamd.git [Minor] Handle null values --- diff --git a/src/libserver/symcache/symcache_c.cxx b/src/libserver/symcache/symcache_c.cxx index 6ab1206c0..bd1c1abc4 100644 --- a/src/libserver/symcache/symcache_c.cxx +++ b/src/libserver/symcache/symcache_c.cxx @@ -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); }