From: Andrew Lewis Date: Mon, 25 Jan 2016 17:31:51 +0000 (+0200) Subject: ratelimit: avoid possible indexing of nil value (Fixes #498) X-Git-Tag: 1.1.2~40^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F499%2Fhead;p=rspamd.git ratelimit: avoid possible indexing of nil value (Fixes #498) --- diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 2eb7f30a7..24c384913 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -252,7 +252,7 @@ local function rate_test_set(task, func) local from = task:get_from() local from_user = '<>' local from_addr = '<>' - if from and from[1]['addr'] then + if from and from[1] and from[1]['addr'] then from_user = from[1]['user'] from_addr = from[1]['addr'] end