]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Check boundary earlier
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 5 May 2021 15:14:01 +0000 (16:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 5 May 2021 15:14:01 +0000 (16:14 +0100)
src/libserver/css/css_tokeniser.cxx

index bc77fc7e3ed97819c59c2dad611d9bf95b156e52..3035a66494bda5ed4349e0c9641af7d0a729c9b2 100644 (file)
@@ -533,9 +533,9 @@ auto css_tokeniser::next_token(void) -> struct css_parser_token
                case '\r':
                case '\v': {
                        /* Consume as much space as we can */
-                       do {
+                       while (i < input.size() && g_ascii_isspace(c)) {
                                c = input[++i];
-                       } while (i < input.size() && g_ascii_isspace(c));
+                       }
 
                        auto ret = make_token<css_parser_token::token_type::whitespace_token>(
                                        std::string_view(&input[offset], i - offset));