diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-11-17 23:51:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-11-17 23:51:46 +0000 |
commit | 07d4d686517add3981792478907cb78810510881 (patch) | |
tree | 12cefe1b66570b7d0cae9dedc3cf5f9cac616dc6 /src/libserver/css | |
parent | ed4f55c76d039bc728bb86128b817aeb5d8d3089 (diff) | |
download | rspamd-07d4d686517add3981792478907cb78810510881.tar.gz rspamd-07d4d686517add3981792478907cb78810510881.zip |
[Minor] Try to fix potential off-by-one error
Diffstat (limited to 'src/libserver/css')
-rw-r--r-- | src/libserver/css/css_tokeniser.cxx | 5 |
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]; |