]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix tags count calculation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 27 Jul 2021 19:07:41 +0000 (20:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 27 Jul 2021 19:07:41 +0000 (20:07 +0100)
src/libserver/html/html.cxx
src/libserver/html/html.hxx

index 1c9a4c4a19a29725656c89c3741872c507459f98..ab49d147bfe39335e29442f4c27f31cabbbe7b73 100644 (file)
@@ -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;
index 71399d27d7bc36b737e92537416e35fc57ce60d8..7e63bedce633a3ab2bc55ab5abfa220062fe8697 100644 (file)
@@ -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<bool> tags_seen;
        std::vector<html_image *> images;
        std::vector<std::unique_ptr<struct html_tag>> all_tags;