]> source.dussan.org Git - rspamd.git/commitdiff
Fix processing of headers.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Nov 2015 15:35:41 +0000 (15:35 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Nov 2015 15:35:41 +0000 (15:35 +0000)
src/libmime/message.c

index a007e61b1a95614535d01476f32e725daef61782..b8f6b387b4c007de5b07258c3072ab44233dcb83 100644 (file)
@@ -1611,9 +1611,9 @@ rspamd_message_parse (struct rspamd_task *task)
 
                        hdr_pos = rspamd_string_find_eoh (&str);
 
-                       if (hdr_pos > 0) {
+                       if (hdr_pos > 0 && hdr_pos < tmp->len) {
                                task->raw_headers_content.begin = (gchar *) (p);
-                               task->raw_headers_content.len = (guint64) (p + hdr_pos);
+                               task->raw_headers_content.len = (guint64) (hdr_pos);
 
                                if (task->raw_headers_content.len > 0) {
                                        process_raw_headers (task, task->raw_headers,