aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libmime/mime_headers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index 085dd3313..26c4165f8 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -260,7 +260,7 @@ rspamd_mime_headers_process (struct rspamd_task *task,
if (*p == '\n') {
nlines_count[RSPAMD_TASK_NEWLINES_LF] ++;
}
- else if (*(p + 1) == '\n') {
+ else if (p + 1 < end && *(p + 1) == '\n') {
nlines_count[RSPAMD_TASK_NEWLINES_CRLF] ++;
}
else {