]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Css: Fix parsing of the url tokens
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 May 2021 14:15:01 +0000 (15:15 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 May 2021 14:15:01 +0000 (15:15 +0100)
src/libserver/css/css_tokeniser.cxx

index f4180b761b4491ad9e8a47cea92062f8ec2baf48..d6ddc2a5f1cd769833b6570e49d84882b23d6fc8 100644 (file)
@@ -249,7 +249,7 @@ auto css_tokeniser::consume_ident(bool allow_number) -> struct css_parser_token
                                        j++;
                                }
 
-                               if (input.size() > 3 && input.substr(0, 3) == "url") {
+                               if (input.size() - offset > 3 && input.substr(offset, 3) == "url") {
                                        if (input[j] == '"' || input[j] == '\'') {
                                                /* Function token */
                                                auto ret = maybe_escape_sv(i,