commit 099ae44: [Minor] Css: Fix parsing of the url tokens

Vsevolod Stakhov vsevolod at highsecure.ru
Thu May 6 15:35:03 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-05-06 15:15:01 +0100
URL: https://github.com/rspamd/rspamd/commit/099ae44013e09d869ec24046ecadbf55038bb878

[Minor] Css: Fix parsing of the url tokens

---
 src/libserver/css/css_tokeniser.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libserver/css/css_tokeniser.cxx b/src/libserver/css/css_tokeniser.cxx
index f4180b761..d6ddc2a5f 100644
--- a/src/libserver/css/css_tokeniser.cxx
+++ b/src/libserver/css/css_tokeniser.cxx
@@ -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,


More information about the Commits mailing list