Browse Source

* avoid stack corruption in CharStr if count > 255

pierre 23 years ago
parent
commit
47b7e5c5b6
1 changed files with 7 additions and 2 deletions
  1. 7 2
      ide/wutils.pas

+ 7 - 2
ide/wutils.pas

@@ -340,7 +340,9 @@ begin
     begin
       CharStr:='';
       exit;
-    end;
+    end
+  else if Count>255 then
+    Count:=255;
 {$ifdef FPC}
   CharStr[0]:=chr(Count);
   FillChar(CharStr[1],Count,C);
@@ -1234,7 +1236,10 @@ BEGIN
 END.
 {
   $Log$
-  Revision 1.5  2001-11-18 20:18:54  peter
+  Revision 1.6  2002-03-20 13:48:31  pierre
+   * avoid stack corruption in CharStr if count > 255
+
+  Revision 1.5  2001/11/18 20:18:54  peter
     * use cp_value_equal_const instead of cp_all
 
   Revision 1.4  2001/09/18 15:36:58  pierre