浏览代码

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

Michaël Van Canneyt 2 年之前
父节点
当前提交
5442155f55
共有 1 个文件被更改,包括 1 次插入0 次删除
  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);