From b88c0f8e3a660f48caad29345924e54d75770e15 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 25 Jan 2016 19:31:51 +0200 Subject: [PATCH] ratelimit: avoid possible indexing of nil value (Fixes #498) --- src/plugins/lua/ratelimit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.5