diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-31 15:39:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-31 15:39:33 +0100 |
commit | 627e54de47805de8e6ae6cb1b62eb308fee2ea3a (patch) | |
tree | 39604cd4ccbf13cb2b053b6e3b701c15f05f6ec0 /src/libmime | |
parent | c4f3ae3fd7f191f130b02a477fd09d073c77167a (diff) | |
download | rspamd-627e54de47805de8e6ae6cb1b62eb308fee2ea3a.tar.gz rspamd-627e54de47805de8e6ae6cb1b62eb308fee2ea3a.zip |
More fixes to reading of empty messages.
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/message.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index ea7e191bb..83345a4d5 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -1527,13 +1527,16 @@ rspamd_message_parse (struct rspamd_task *task) hdr_start = g_mime_parser_get_headers_begin (parser); hdr_end = g_mime_parser_get_headers_end (parser); if (hdr_start != -1 && hdr_end != -1) { - g_assert (hdr_start < hdr_end); + g_assert (hdr_start <= hdr_end); g_assert (hdr_end <= (gint64)len); task->raw_headers_content.begin = (gchar *)(p + hdr_start); task->raw_headers_content.len = (guint64)(hdr_end - hdr_start); - process_raw_headers (task, task->raw_headers, - task->raw_headers_content.begin, - task->raw_headers_content.len); + + if (task->raw_headers_content.len > 0) { + process_raw_headers (task, task->raw_headers, + task->raw_headers_content.begin, + task->raw_headers_content.len); + } } rspamd_images_process (task); |