aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-01-25 19:31:51 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-01-25 19:31:51 +0200
commitb88c0f8e3a660f48caad29345924e54d75770e15 (patch)
tree6d4ed2652999910793c4b43908d055bfd981e876 /src
parent2a81086ec387a9a874900bceed0b0cca2032bdc9 (diff)
downloadrspamd-b88c0f8e3a660f48caad29345924e54d75770e15.tar.gz
rspamd-b88c0f8e3a660f48caad29345924e54d75770e15.zip
ratelimit: avoid possible indexing of nil value (Fixes #498)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/ratelimit.lua2
1 files changed, 1 insertions, 1 deletions
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