diff options
author | Andrew Lewis <nerf@judo.za.org> | 2018-01-17 18:41:44 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2018-01-24 14:14:05 +0200 |
commit | 3e4f2b256f17a2d74bb4c378a77e4719c94735b8 (patch) | |
tree | da1ee74065a94dcbf400d0c155ac7540f42a4432 | |
parent | dcdfbdee9b7877c6156589f1a05731d3e5b8dff8 (diff) | |
download | rspamd-3e4f2b256f17a2d74bb4c378a77e4719c94735b8.tar.gz rspamd-3e4f2b256f17a2d74bb4c378a77e4719c94735b8.zip |
[Minor] CHECK_FROM rule: avoid indexing of nil
-rw-r--r-- | rules/headers_checks.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index 37ec044ec..8448fad96 100644 --- a/rules/headers_checks.lua +++ b/rules/headers_checks.lua @@ -593,11 +593,11 @@ local check_from_id = rspamd_config:register_symbol{ then task:insert_result('FROM_EQ_ENVFROM', 1.0) elseif (envfrom and envfrom[1] and envfrom[1].addr) then - task:insert_result('FROM_NEQ_ENVFROM', 1.0, from and from[1].addr or '', envfrom[1].addr) + task:insert_result('FROM_NEQ_ENVFROM', 1.0, ((from or E)[1] or E).addr or '', envfrom[1].addr) end local to = task:get_recipients(2) - if not (to and to[1] and #to == 1 and from) then return false end + if not (to and to[1] and #to == 1 and from and from[1]) then return false end -- Check if FROM == TO if (util.strequal_caseless(to[1].addr, from[1].addr)) then task:insert_result('TO_EQ_FROM', 1.0) |