aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-11-17 23:51:46 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-11-17 23:51:46 +0000
commit07d4d686517add3981792478907cb78810510881 (patch)
tree12cefe1b66570b7d0cae9dedc3cf5f9cac616dc6
parented4f55c76d039bc728bb86128b817aeb5d8d3089 (diff)
downloadrspamd-07d4d686517add3981792478907cb78810510881.tar.gz
rspamd-07d4d686517add3981792478907cb78810510881.zip
[Minor] Try to fix potential off-by-one error
-rw-r--r--src/libserver/css/css_tokeniser.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libserver/css/css_tokeniser.cxx b/src/libserver/css/css_tokeniser.cxx
index 737b3460d..ace94cae2 100644
--- a/src/libserver/css/css_tokeniser.cxx
+++ b/src/libserver/css/css_tokeniser.cxx
@@ -441,6 +441,11 @@ auto css_tokeniser::next_token(void) -> struct css_parser_token
auto i = offset;
auto nested = 0;
+ if (input.empty()) {
+ /* Nothing to consume */
+ return;
+ }
+
/* We handle nested comments just because they can exist... */
while (i < input.size() - 1) {
auto c = input[i];