Browse Source

* fix for SIGSEGV due to access to uninitialized pointers in TList

Tomas Hajny 20 years ago
parent
commit
c2d6555bd5
1 changed files with 7 additions and 1 deletions
  1. 7 1
      fcl/classes/lists.inc

+ 7 - 1
fcl/classes/lists.inc

@@ -84,6 +84,9 @@ begin
   if NewCapacity=FCapacity then
     exit;
   ReallocMem(FList,SizeOf(Pointer)*NewCapacity);
+  if NewCapacity > FCapacity then
+    FillChar (FList^ [FCapacity],
+                              (NewCapacity - FCapacity) * SizeOf (pointer), 0);
   FCapacity:=NewCapacity;
 end;
 
@@ -450,7 +453,10 @@ end;
 
 {
   $Log$
-  Revision 1.3  2005-02-14 17:13:11  peter
+  Revision 1.4  2005-05-12 21:47:34  hajny
+    * fix for SIGSEGV due to access to uninitialized pointers in TList
+
+  Revision 1.3  2005/02/14 17:13:11  peter
     * truncate log
 
 }