commit b14e941: [Minor] Fix issues with values check
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Mar 1 10:35:06 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-03-01 10:34:07 +0000
URL: https://github.com/rspamd/rspamd/commit/b14e9419ca91f289fa717ce27da99819197ee57f (HEAD -> master)
[Minor] Fix issues with values check
---
lualib/lua_mime.lua | 6 ++++--
src/libmime/mime_headers.c | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/lualib/lua_mime.lua b/lualib/lua_mime.lua
index d94335f5b..3b8344e5f 100644
--- a/lualib/lua_mime.lua
+++ b/lualib/lua_mime.lua
@@ -526,8 +526,10 @@ exports.modify_headers = function(task, hdr_alterations)
local add_tbl = hdr_flattened[hname].add
if hdr.value then
table.insert(add_tbl, {hdr.order or -1, hdr.value})
- else
- table.insert(add_tbl, {-1, hdr})
+ elseif type(hdr) == 'table' then
+ for _,v in ipairs(hdr) do
+ table.insert(add_tbl, {-1, v})
+ end
end
end
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index a480c6fc6..bb7b9373a 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -1894,7 +1894,9 @@ rspamd_message_set_modified_header (struct rspamd_task *task,
const ucl_object_t *order = ucl_array_find_index (cur, 0),
*value = ucl_array_find_index (cur, 1);
- if (order && value) {
+ if (order && value &&
+ (ucl_object_type (order) == UCL_INT &&
+ ucl_object_type (value) == UCL_STRING)) {
int ord = ucl_object_toint (order);
const char *raw_value;
gsize raw_len;
More information about the Commits
mailing list