From 0a32776e986b09cc05232dfb7bdfce78fb956cd1 Mon Sep 17 00:00:00 2001 From: Bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sun, 31 Oct 2021 16:19:49 +0100 Subject: [PATCH] LazUtils: Masks: an empty negated set is also an empty set, so don't allow that as well. --- components/lazutils/masks.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lazutils/masks.pas b/components/lazutils/masks.pas index 332f61f812..c9f6d8bdd4 100644 --- a/components/lazutils/masks.pas +++ b/components/lazutils/masks.pas @@ -785,7 +785,7 @@ begin fLastOC:=TMaskParsedCode.Range; end else if fMask[fMaskInd]=']' then begin - if fLastOC=TMaskParsedCode.CharsGroupBegin then + if (fLastOC=TMaskParsedCode.CharsGroupBegin) or (fLastOC=TMaskParsedCode.Negate) then Exception_InvalidCharMask(fMask[fMaskInd],fMaskInd); //Error empty match // Insert the new offset in case of a positive match in CharsGroup PInteger(@fMaskCompiled[lCharsGroupInsertSize])^:=fMaskCompiledIndex;