]> source.dussan.org Git - rspamd.git/commitdiff
ratelimit: avoid possible indexing of nil value (Fixes #498) 499/head
authorAndrew Lewis <nerf@judo.za.org>
Mon, 25 Jan 2016 17:31:51 +0000 (19:31 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 25 Jan 2016 17:31:51 +0000 (19:31 +0200)
src/plugins/lua/ratelimit.lua

index 2eb7f30a73a8bb6049ccb84321f7375faa62b4a9..24c3849136d91fbac3647626df28656b1e3e7e0f 100644 (file)
@@ -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