diff options
-rw-r--r-- | src/libmime/mime_headers.c | 7 | ||||
-rw-r--r-- | test/lua/unit/received.lua | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index 0a79e3441..d0388a632 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -1092,10 +1092,14 @@ rspamd_smtp_received_process_part (struct rspamd_task *task, &npart->data, &npart->dlen); } + *last = p - (const guchar *)data; + return npart; } break; case skip_spaces: + *last = p - (const guchar *)data; + return npart; default: break; @@ -1141,6 +1145,7 @@ rspamd_smtp_received_spill (struct rspamd_task *task, return NULL; } + g_assert (pos != 0); p += pos; len = end > p ? end - p : 0; DL_APPEND (head, cur_part); @@ -1157,6 +1162,7 @@ rspamd_smtp_received_spill (struct rspamd_task *task, return NULL; } + g_assert (pos != 0); p += pos; len = end > p ? end - p : 0; DL_APPEND (head, cur_part); @@ -1212,6 +1218,7 @@ rspamd_smtp_received_spill (struct rspamd_task *task, return NULL; } else { + g_assert (pos != 0); p += pos; len = end > p ? end - p : 0; DL_APPEND (head, cur_part); diff --git a/test/lua/unit/received.lua b/test/lua/unit/received.lua index 19decc397..c633a99b1 100644 --- a/test/lua/unit/received.lua +++ b/test/lua/unit/received.lua @@ -25,6 +25,12 @@ context("Received headers parser", function() ]] local cases = { + {[[from smtp11.mailtrack.pl (smtp11.mailtrack.pl [185.243.30.90])]], + { + real_ip = '185.243.30.90', + real_hostname = 'smtp11.mailtrack.pl' + }, + }, {[[from asx121.turbo-inline.com [7.165.23.113] by mx.reskind.net with QMQP; Fri, 08 Feb 2019 06:56:18 -0500]], { real_ip = '7.165.23.113', |