Browse Source

* Fix from Bart for range check error. Fix issue #40240

Michaël Van Canneyt 2 years ago
parent
commit
3b58e18065
1 changed files with 1 additions and 0 deletions
  1. 1 0
      packages/fcl-base/src/fptemplate.pp

+ 1 - 0
packages/fcl-base/src/fptemplate.pp

@@ -382,6 +382,7 @@ Var
   SLen : Integer;
 
 begin
+  if (NChars=0) then Exit;
   SLen:=Length(S);
   SetLength(S,SLen+NChars);
   Move(P^,S[Slen+1],NChars);