diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-01 14:08:45 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-01 14:08:45 +0000 |
commit | 50c6b049c58f561ea60d7436bd6fc27ce64d827d (patch) | |
tree | 30f2b620829c79ff25260a14626bec5020a1d0a8 /src/plugins | |
parent | 5d17ca75aa180e424a4d53c1ffad31644170f096 (diff) | |
download | rspamd-50c6b049c58f561ea60d7436bd6fc27ce64d827d.tar.gz rspamd-50c6b049c58f561ea60d7436bd6fc27ce64d827d.zip |
[Minor] Initialise table first
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/arc.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index 302861755..59d97fcd4 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -91,6 +91,7 @@ local settings = { } local function parse_arc_header(hdr, target) + -- Split elements by ';' and trim spaces local arr = fun.totable(fun.map( function(val) return fun.totable(fun.map(lua_util.rspamd_str_trim, @@ -102,8 +103,9 @@ local function parse_arc_header(hdr, target) -- Now we have two tables in format: -- [sigs] -> [{sig1_elts}, {sig2_elts}...] for i,elts in ipairs(arr) do + if not target[i] then target[i] = {} end + -- Split by kv pair, like k=v fun.each(function(v) - if not target[i] then target[i] = {} end if v[1] and v[2] then target[i][v[1]] = v[2] end |