aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-02 18:53:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-02 18:53:31 +0100
commitf52ea5e83fba08d5755506a6987ca3bb9ee0ab53 (patch)
treed1cad39504b671c62d2411fd750b5a0672a44a33 /src/libserver/task.c
parentf20d5669094f438509e84fb762149ddc96a5706c (diff)
downloadrspamd-f52ea5e83fba08d5755506a6987ca3bb9ee0ab53.tar.gz
rspamd-f52ea5e83fba08d5755506a6987ca3bb9ee0ab53.zip
Fix processing of empty messages.
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r--src/libserver/task.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index c04aecc0f..97ed76b5c 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -247,6 +247,14 @@ rspamd_task_load_message (struct rspamd_task *task,
task->msg.start = start;
task->msg.len = len;
+ if (task->msg.len == 0) {
+ msg_warn ("message has invalid message length: %ud",
+ task->msg.len);
+ g_set_error (&task->err, rspamd_task_quark(), RSPAMD_PROTOCOL_ERROR,
+ "Invalid length");
+ return FALSE;
+ }
+
if (msg) {
rspamd_protocol_handle_headers (task, msg);
}