From: Vsevolod Stakhov Date: Thu, 17 Nov 2022 23:51:46 +0000 (+0000) Subject: [Minor] Try to fix potential off-by-one error X-Git-Tag: 3.5~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07d4d686517add3981792478907cb78810510881;p=thirdparty%2Frspamd.git [Minor] Try to fix potential off-by-one error --- diff --git a/src/libserver/css/css_tokeniser.cxx b/src/libserver/css/css_tokeniser.cxx index 737b3460df..ace94cae2d 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];