From 07d4d686517add3981792478907cb78810510881 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 17 Nov 2022 23:51:46 +0000 Subject: [PATCH] [Minor] Try to fix potential off-by-one error --- src/libserver/css/css_tokeniser.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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]; -- 2.39.5