aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-09 17:04:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-09 17:04:13 +0000
commit80031db8e54a68d6e1c09df5c69864ad9beff2b2 (patch)
tree162712301e8bd4635f718a37ba76e2ebd7be4a29 /src
parentd10012653e3fc6447461b7920fef24eca2985b00 (diff)
downloadrspamd-80031db8e54a68d6e1c09df5c69864ad9beff2b2.tar.gz
rspamd-80031db8e54a68d6e1c09df5c69864ad9beff2b2.zip
[Fix] Fix task:set_recipients function
Diffstat (limited to 'src')
-rw-r--r--src/lua/lua_task.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index cfb56a3a1..620a9d7f6 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -2166,7 +2166,7 @@ lua_task_set_recipients (lua_State *L)
gint what = 0, pos = 3;
if (task) {
- if (lua_isstring (L, 2)) {
+ if (lua_isstring (L, 2) || lua_isnumber (L, 2)) {
/* Get what value */
what = lua_task_str_to_get_type (L, 2);
}
@@ -2198,7 +2198,7 @@ lua_task_set_recipients (lua_State *L)
g_ptr_array_set_size (ptrs, 0);
for (lua_pushnil (L); lua_next (L, -2); lua_pop (L, 1)) {
- if (lua_import_email_address (L, task, -1, &addr)) {
+ if (lua_import_email_address (L, task, lua_gettop (L), &addr)) {
g_ptr_array_add (ptrs, addr);
addr = NULL;
}
@@ -2387,7 +2387,7 @@ lua_task_set_from (lua_State *L)
gint what = 0, pos = 3;
if (task) {
- if (lua_isstring (L, 2)) {
+ if (lua_isstring (L, 2) || lua_isnumber (L, 2)) {
/* Get what value */
what = lua_task_str_to_get_type (L, 2);
}
@@ -2721,7 +2721,7 @@ lua_push_symbol_result (lua_State *L,
const gboolean add_name)
{
struct rspamd_metric_result *metric_res;
- struct rspamd_symbol_result *s;
+ struct rspamd_symbol_result *s = NULL;
gint j, e;
if (!symbol_result) {