aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/mime_parser.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-27 10:47:34 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-27 10:47:34 +0100
commitbdcbf7aa2db8dd9acfd8fd1c08b7909de5106760 (patch)
tree8b4fa38a78a9d55cff8438239269f518850c8335 /src/libmime/mime_parser.c
parentb07b8c60f7079820b8253015f00a3876f7c296cb (diff)
downloadrspamd-bdcbf7aa2db8dd9acfd8fd1c08b7909de5106760.tar.gz
rspamd-bdcbf7aa2db8dd9acfd8fd1c08b7909de5106760.zip
[Minor] Fix OOB access
Diffstat (limited to 'src/libmime/mime_parser.c')
-rw-r--r--src/libmime/mime_parser.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c
index 1153a54c7..1c132335c 100644
--- a/src/libmime/mime_parser.c
+++ b/src/libmime/mime_parser.c
@@ -927,17 +927,19 @@ rspamd_mime_preprocess_cb (struct rspamd_multipattern *mp,
bend ++;
}
- if (*bend == '\r') {
- bend ++;
+ if (bend < end) {
+ if (*bend == '\r') {
+ bend++;
- /* \r\n */
- if (*bend == '\n') {
- bend ++;
+ /* \r\n */
+ if (*bend == '\n') {
+ bend++;
+ }
+ }
+ else {
+ /* \n */
+ bend++;
}
- }
- else {
- /* \n */
- bend ++;
}
b.boundary = p - st->start - 2;