aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver')
-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);
}