commit 0cd0119: [Minor] Fix off-by-one error when parsing id selectors

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jul 19 13:21:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-07-19 12:16:03 +0100
URL: https://github.com/rspamd/rspamd/commit/0cd011920b3f48fac63139bfa5d6ca685a6235a5

[Minor] Fix off-by-one error when parsing id selectors

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

diff --git a/src/libserver/css/css_selector.cxx b/src/libserver/css/css_selector.cxx
index 75baec8f2..86ff482fe 100644
--- a/src/libserver/css/css_selector.cxx
+++ b/src/libserver/css/css_selector.cxx
@@ -87,7 +87,7 @@ auto process_selector_tokens(rspamd_mempool_t *pool,
 					cur_selector = std::make_unique<css_selector>(
 							css_selector::selector_type::SELECTOR_ID);
 					cur_selector->value =
-							parser_tok.get_string_or_default("").substr(1);
+							parser_tok.get_string_or_default("");
 					state = selector_process_state::selector_ident_consumed;
 					break;
 				default:


More information about the Commits mailing list