diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-02 18:53:31 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-02 18:53:31 +0100 |
commit | f52ea5e83fba08d5755506a6987ca3bb9ee0ab53 (patch) | |
tree | d1cad39504b671c62d2411fd750b5a0672a44a33 /src/libserver/task.c | |
parent | f20d5669094f438509e84fb762149ddc96a5706c (diff) | |
download | rspamd-f52ea5e83fba08d5755506a6987ca3bb9ee0ab53.tar.gz rspamd-f52ea5e83fba08d5755506a6987ca3bb9ee0ab53.zip |
Fix processing of empty messages.
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r-- | src/libserver/task.c | 8 |
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); } |