From 03f73692a9cdc4b42aede804faa44572545ebdfc Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 4 Dec 2021 14:20:26 +0000 Subject: [PATCH] [Minor] Fix enum handling --- src/libserver/html/html.cxx | 2 +- src/libserver/html/html_tag.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index a920f9a4f..c782148d2 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 5971ca179..ba086be82 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; -- 2.39.5