]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Copy&paste fix for copy&paste OOB access
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 25 Sep 2019 15:39:29 +0000 (16:39 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 25 Sep 2019 15:39:29 +0000 (16:39 +0100)
src/libmime/mime_headers.c

index 26c4165f80708badd3c3161c612dfa3bfcc8e421..f1bea0d615d7265ed0844df8b8334e5a48d073b4 100644 (file)
@@ -299,7 +299,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 {