diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-12 21:52:28 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-12 21:52:28 +0100 |
commit | 1e7d04a8a1e9f7b3d246f01a131a3edc8fa81682 (patch) | |
tree | b93cb52fc3a8f38b53136096e6a753bd5032772f | |
parent | 349f4291d308ab1db7b9bcb7f8cc8c60dcad57f5 (diff) | |
download | rspamd-1e7d04a8a1e9f7b3d246f01a131a3edc8fa81682.tar.gz rspamd-1e7d04a8a1e9f7b3d246f01a131a3edc8fa81682.zip |
[Minor] Handle null values
-rw-r--r-- | src/libserver/symcache/symcache_c.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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); } |