]> source.dussan.org Git - rspamd.git/commitdiff
fix: attempt to index field '?' (a nil value) 160/head
authoreneq123 <you@example.com>
Thu, 12 Feb 2015 20:18:29 +0000 (23:18 +0300)
committereneq123 <you@example.com>
Thu, 12 Feb 2015 20:18:29 +0000 (23:18 +0300)
src/plugins/lua/forged_recipients.lua

index 44cd6994a970399cfb9d837a0e2735c644fc7733..2fea63eae1475b46470c295ad0e24560fb9af200 100644 (file)
@@ -38,7 +38,7 @@ function check_forged_headers(task)
        local smtp_from = task:get_from(1)
        if smtp_from then
                local mime_from = task:get_from(2)
-               if not mime_from or not (string.lower(mime_from[1]['addr']) == string.lower(smtp_from[1]['addr'])) then
+               if not mime_from or not mime_from[1] or not (string.lower(mime_from[1]['addr']) == string.lower(smtp_from[1]['addr'])) then
                        task:insert_result(symbol_sender, 1)
                end
        end