]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Try to fix potential off-by-one error
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 17 Nov 2022 23:51:46 +0000 (23:51 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 17 Nov 2022 23:51:46 +0000 (23:51 +0000)
src/libserver/css/css_tokeniser.cxx

index 737b3460df361c49252d2197fc093b44a3347ab4..ace94cae2dfbb631aa27aa76b1a907871ec77573 100644 (file)
@@ -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];