From a9c4f69ca5e17005d8a96af748901a4337b4bc08 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 27 Jul 2021 20:07:41 +0100 Subject: [PATCH] [Minor] Fix tags count calculation --- src/libserver/html/html.cxx | 2 +- src/libserver/html/html.hxx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index 1c9a4c4a1..ab49d147b 100644 --- a/src/libserver/html/html.cxx +++ b/src/libserver/html/html.cxx @@ -1283,7 +1283,7 @@ html_process_input(rspamd_mempool_t *pool, auto new_tag = [&](int flags = 0) -> struct html_tag * { - if (hc->total_tags > rspamd::html::max_tags) { + if (hc->all_tags.size() > rspamd::html::max_tags) { hc->flags |= RSPAMD_HTML_FLAG_TOO_MANY_TAGS; return nullptr; diff --git a/src/libserver/html/html.hxx b/src/libserver/html/html.hxx index 71399d27d..7e63bedce 100644 --- a/src/libserver/html/html.hxx +++ b/src/libserver/html/html.hxx @@ -43,7 +43,6 @@ struct html_content { struct rspamd_url *base_url = nullptr; struct html_tag *root_tag = nullptr; gint flags = 0; - guint total_tags = 0; std::vector tags_seen; std::vector images; std::vector> all_tags; -- 2.39.5