aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-09 12:00:06 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-09 12:00:06 +0100
commit4219a66db3f633d102dfe38e5315f0f552b85262 (patch)
tree755da52c59c6ea6c34afb19a592302b7746085b2 /src/lua
parent4b92cb19c48639d65f68f0292dd342bb1a38e62d (diff)
downloadrspamd-4219a66db3f633d102dfe38e5315f0f552b85262.tar.gz
rspamd-4219a66db3f633d102dfe38e5315f0f552b85262.zip
[Minor] Fix task from string creation
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_task.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 576c7e1cc..cd33ac2e0 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -1669,8 +1669,9 @@ lua_task_load_from_string (lua_State * L)
}
task = rspamd_task_new (NULL, cfg, NULL, NULL, NULL);
- task->msg.begin = g_strdup (str_message);
- task->msg.len = message_len;
+ task->msg.begin = g_malloc (message_len);
+ memcpy ((gchar *)task->msg.begin, str_message, message_len);
+ task->msg.len = message_len;
rspamd_mempool_add_destructor (task->task_pool, lua_task_free_dtor,
(gpointer)task->msg.begin);
}