From d5e1ced666985186905afcba033d8c009e9e0334 Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sun, 9 Feb 2014 16:40:44 +0000 Subject: [PATCH] MaskEdit: fix possible crash in PasteFromClipBoard. git-svn-id: trunk@43985 - --- lcl/maskedit.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lcl/maskedit.pp b/lcl/maskedit.pp index f926385722..f9675fff54 100644 --- a/lcl/maskedit.pp +++ b/lcl/maskedit.pp @@ -1927,7 +1927,7 @@ begin //debugln(' P = ',dbgs(p)); //debugln(' S = ',s); //debugln(' ClipText = ',ClipText); - while (P <= FMaskLength) do + while (P <= FMaskLength) and (i <= Utf8Length(ClipText)) do begin //Skip any literal while (P < FMaskLength) and (IsLiteral(FMask[P])) do Inc(P);