diff options
-rw-r--r-- | src/libserver/composites/composites.cxx | 3 | ||||
-rw-r--r-- | src/libserver/composites/composites_internal.hxx | 2 | ||||
-rw-r--r-- | src/libserver/composites/composites_manager.cxx | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/libserver/composites/composites.cxx b/src/libserver/composites/composites.cxx index b03edaf71..99a2038c3 100644 --- a/src/libserver/composites/composites.cxx +++ b/src/libserver/composites/composites.cxx @@ -88,7 +88,8 @@ struct composites_data { explicit composites_data(struct rspamd_task *task, struct rspamd_scan_result *mres) : task(task), composite(nullptr), metric_res(mres) { - checked.resize(rspamd_composites_manager_nelts(task->cfg->composites_manager) * 2); + checked.resize(rspamd_composites_manager_nelts(task->cfg->composites_manager) * 2, + false); } }; diff --git a/src/libserver/composites/composites_internal.hxx b/src/libserver/composites/composites_internal.hxx index 12fa3ecb2..c38f3d377 100644 --- a/src/libserver/composites/composites_internal.hxx +++ b/src/libserver/composites/composites_internal.hxx @@ -57,7 +57,7 @@ public: } auto size(void) const -> std::size_t { - return composites.size(); + return all_composites.size(); } auto find(std::string_view name) const -> const rspamd_composite * { diff --git a/src/libserver/composites/composites_manager.cxx b/src/libserver/composites/composites_manager.cxx index c2e719c89..cf91d1136 100644 --- a/src/libserver/composites/composites_manager.cxx +++ b/src/libserver/composites/composites_manager.cxx @@ -87,7 +87,7 @@ composites_manager::add_composite(std::string_view composite_name, const ucl_obj auto &composite = all_composites.emplace_back(std::make_shared<rspamd_composite>()); composite->expr = expr; - composite->id = all_composites.size(); + composite->id = all_composites.size() - 1; composite->str_expr = composite_expression; composite->sym = composite_name; |