diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-21 12:10:21 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-21 12:10:21 +0100 |
commit | e591dcd91f5e6d1d3519e6e458427f1c649d4894 (patch) | |
tree | 607ecb35d13fc2ba1f4ac2eb0c47af745d396b51 /src | |
parent | e241197bb9d4dfa51d36fb1fa7978df572df87f9 (diff) | |
download | rspamd-e591dcd91f5e6d1d3519e6e458427f1c649d4894.tar.gz rspamd-e591dcd91f5e6d1d3519e6e458427f1c649d4894.zip |
[Minor] Relax requirements to find end-of-headers
Issue: #2349
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/str_util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index d17485ebf..4cdae61d4 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -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; |