rspamd_symcache_item_name(struct rspamd_symcache_item *item)
{
auto *real_item = C_API_SYMCACHE_ITEM(item);
+
+ if (real_item == nullptr) {
+ return 0;
+ }
+
return real_item->get_name().c_str();
}
rspamd_symcache_item_flags(struct rspamd_symcache_item *item)
{
auto *real_item = C_API_SYMCACHE_ITEM(item);
+
+ if (real_item == nullptr) {
+ return 0;
+ }
+
return real_item->get_flags();
}
auto *cache_runtime = C_API_SYMCACHE_RUNTIME(task->symcache_runtime);
auto *real_cache = C_API_SYMCACHE(cache);
+ if (cache_runtime == nullptr) {
+ return FALSE;
+ }
+
return cache_runtime->disable_symbol(task, *real_cache, symbol);
}
auto *cache_runtime = C_API_SYMCACHE_RUNTIME(task->symcache_runtime);
auto *real_cache = C_API_SYMCACHE(cache);
+ if (cache_runtime == nullptr) {
+ return FALSE;
+ }
+
return cache_runtime->enable_symbol(task, *real_cache, symbol);
}
auto *cache_runtime = C_API_SYMCACHE_RUNTIME(task->symcache_runtime);
auto *real_cache = C_API_SYMCACHE(cache);
+ if (cache_runtime == nullptr) {
+ return FALSE;
+ }
+
return cache_runtime->is_symbol_checked(*real_cache, symbol);
}
auto *cache_runtime = C_API_SYMCACHE_RUNTIME(task->symcache_runtime);
auto *real_cache = C_API_SYMCACHE(cache);
+ if (cache_runtime == nullptr) {
+ return FALSE;
+ }
+
return cache_runtime->process_settings(task, *real_cache);
}
{
auto *real_item = C_API_SYMCACHE_ITEM(item);
+ if (real_item == nullptr) {
+ return TRUE;
+ }
+
return real_item->is_allowed(task, exec_only);
}
auto *real_cache = C_API_SYMCACHE(cache);
if (!cache_runtime) {
- /* XXX: ugly hack to enable classification during learning... */
return TRUE;
}
{
auto *cache_runtime = C_API_SYMCACHE_RUNTIME(task->symcache_runtime);
+ if (!cache_runtime) {
+ return nullptr;
+ }
+
return (struct rspamd_symcache_item *) cache_runtime->get_cur_item();
}
auto *cache_runtime = C_API_SYMCACHE_RUNTIME(task->symcache_runtime);
auto *real_item = C_API_SYMCACHE_ITEM(item);
+ if (!cache_runtime || !real_item) {
+ return nullptr;
+ }
+
return (struct rspamd_symcache_item *) cache_runtime->set_cur_item(real_item);
}
rspamd_symcache_enable_profile(struct rspamd_task *task)
{
auto *cache_runtime = C_API_SYMCACHE_RUNTIME(task->symcache_runtime);
+ if (!cache_runtime) {
+ return;
+ }
cache_runtime->set_profile_mode(true);
}