]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Relax requirements to find end-of-headers
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 21 Jul 2018 11:10:21 +0000 (12:10 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 21 Jul 2018 11:10:21 +0000 (12:10 +0100)
Issue: #2349

src/libutil/str_util.c

index d17485ebfed566c178bbaf480b88b8fc683941c0..4cdae61d441fe5003afd00bb31db03979c632451 100644 (file)
@@ -1455,6 +1455,10 @@ rspamd_string_find_eoh (GString *input, goffset *body_start)
                                p++;
                                state = got_lf;
                        }
+                       else if (g_ascii_isspace (*p)) {
+                               /* We have \r<space>*, allow to stay in this state */
+                               p ++;
+                       }
                        else {
                                p++;
                                state = skip_char;
@@ -1471,6 +1475,10 @@ rspamd_string_find_eoh (GString *input, goffset *body_start)
                        else if (*p == '\r') {
                                state = got_linebreak;
                        }
+                       else if (g_ascii_isspace (*p)) {
+                               /* We have \n<space>*, allow to stay in this state */
+                               p ++;
+                       }
                        else {
                                p++;
                                state = skip_char;
@@ -1487,6 +1495,10 @@ rspamd_string_find_eoh (GString *input, goffset *body_start)
                                p++;
                                state = got_linebreak_lf;
                        }
+                       else if (g_ascii_isspace (*p)) {
+                               /* We have <linebreak><space>*, allow to stay in this state */
+                               p ++;
+                       }
                        else {
                                p++;
                                state = skip_char;
@@ -1502,6 +1514,10 @@ rspamd_string_find_eoh (GString *input, goffset *body_start)
                                state = got_linebreak_lf;
                                p++;
                        }
+                       else if (g_ascii_isspace (*p)) {
+                               /* We have \r\n<space>*, allow to keep in this state */
+                               p ++;
+                       }
                        else {
                                p++;
                                state = skip_char;