From: Vsevolod Stakhov Date: Wed, 8 Dec 2021 14:05:35 +0000 (+0000) Subject: [Minor] Another ubsan catch X-Git-Tag: 3.2~179 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ada2d8000bb8ff179fc0a9811fa69f8a698be22d;p=thirdparty%2Frspamd.git [Minor] Another ubsan catch --- diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index c782148d2e..79120d1098 100644 --- a/src/libserver/html/html.cxx +++ b/src/libserver/html/html.cxx @@ -2254,10 +2254,12 @@ rspamd_html_tag_seen(void *ptr, const gchar *tagname) const gchar * rspamd_html_tag_by_id(gint id) { - const auto *td = rspamd::html::html_tags_defs.by_id(id); + if (id > Tag_UNKNOWN && id < Tag_MAX) { + const auto *td = rspamd::html::html_tags_defs.by_id(id); - if (td != nullptr) { - return td->name.c_str(); + if (td != nullptr) { + return td->name.c_str(); + } } return nullptr; diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 8ae9030783..2edc87870c 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -821,6 +821,7 @@ local function multimap_callback(task, rule) end else local hv = task:get_header_full(rule['header']) + lua_util.debugm(N, task, "hui: %s", hv) match_list(rule, hv, {'decoded'}) end end,