]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix enum handling
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 4 Dec 2021 14:20:26 +0000 (14:20 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 4 Dec 2021 14:20:26 +0000 (14:20 +0000)
src/libserver/html/html.cxx
src/libserver/html/html_tag.hxx

index a920f9a4f544fbcedf08d1c6e03b24ae5dc7c4e7..c782148d2e3197c818de39a09e424d5f95121ba6 100644 (file)
@@ -2017,7 +2017,7 @@ html_process_input(rspamd_mempool_t *pool,
        /* Propagate styles */
        hc->traverse_block_tags([&hc, &pool](const html_tag *tag) -> bool {
 
-               if (hc->css_style) {
+               if (hc->css_style && tag->id > Tag_UNKNOWN && tag->id < Tag_MAX) {
                        auto *css_block = hc->css_style->check_tag_block(tag);
 
                        if (css_block) {
index 5971ca179b0007f0b6789c5b083307405f49b7ac..ba086be820d8bbedc734efbef012482fb0490b3d 100644 (file)
@@ -91,7 +91,7 @@ struct html_tag {
        unsigned int tag_start = 0;
        unsigned int content_offset = 0;
        std::uint32_t flags = 0;
-       tag_id_t id = Tag_UNKNOWN;
+       std::int32_t id = Tag_UNKNOWN;
        html_closing_tag closing;
 
        std::vector<html_tag_component> components;