commit ada2d80: [Minor] Another ubsan catch
Vsevolod Stakhov
vsevolod at highsecure.ru
Wed Dec 8 14:07:04 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-12-08 14:05:35 +0000
URL: https://github.com/rspamd/rspamd/commit/ada2d8000bb8ff179fc0a9811fa69f8a698be22d (HEAD -> master)
[Minor] Another ubsan catch
---
src/libserver/html/html.cxx | 8 +++++---
src/plugins/lua/multimap.lua | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx
index c782148d2..79120d109 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 8ae903078..2edc87870 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,
More information about the Commits
mailing list