From: Vsevolod Stakhov Date: Sat, 4 Dec 2021 14:20:26 +0000 (+0000) Subject: [Minor] Fix enum handling X-Git-Tag: 3.2~199 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03f73692a9cdc4b42aede804faa44572545ebdfc;p=thirdparty%2Frspamd.git [Minor] Fix enum handling --- diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index a920f9a4f5..c782148d2e 100644 --- a/src/libserver/html/html.cxx +++ b/src/libserver/html/html.cxx @@ -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) { diff --git a/src/libserver/html/html_tag.hxx b/src/libserver/html/html_tag.hxx index 5971ca179b..ba086be820 100644 --- a/src/libserver/html/html_tag.hxx +++ b/src/libserver/html/html_tag.hxx @@ -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 components;