diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-07 21:46:03 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-07 21:46:03 +0100 |
commit | 8617105c7cb7079ba20fa8aaf106b53abac278c3 (patch) | |
tree | 84850e78b159731dfb5b3955b10d0aa7b66b2667 | |
parent | 2367a70d32a34ae044c209a76eafe605a820ae81 (diff) | |
download | rspamd-8617105c7cb7079ba20fa8aaf106b53abac278c3.tar.gz rspamd-8617105c7cb7079ba20fa8aaf106b53abac278c3.zip |
[Minor] Fix entities with space decoding
-rw-r--r-- | src/libserver/html/html_entities.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx index 9ed080d4f..84e05953d 100644 --- a/src/libserver/html/html_entities.cxx +++ b/src/libserver/html/html_entities.cxx @@ -2474,6 +2474,11 @@ decode_html_entitles_inplace(char *s, std::size_t len, bool norm_spaces) if ((*h == ';' || g_ascii_isspace(*h)) && h > e) { replace_entity(); state = parser_state::normal_content; + + if (g_ascii_isspace(*h)) { + /* Avoid increase of h */ + continue; + } } else if (*h == '&') { /* Previous `&` was bogus */ @@ -2580,7 +2585,7 @@ TEST_SUITE("html") { {" abc def ", "abc def "}, {"FOO>BAR", "FOO>BAR"}, {"FOO>BAR", "FOO>BAR"}, - {"FOO> BAR", "FOO>BAR"}, + {"FOO> BAR", "FOO> BAR"}, {"FOO>;;BAR", "FOO>;;BAR"}, {"I'm ¬it;", "I'm ¬it;"}, {"I'm ∉", "I'm ∉"}, |