Jelajahi Sumber

* fix for potential SIGSEGV during argv allocation

Tomas Hajny 20 tahun lalu
induk
melakukan
3ddd944b81
2 mengubah file dengan 10 tambahan dan 7 penghapusan
  1. 5 3
      rtl/morphos/system.pp
  2. 5 4
      rtl/watcom/system.pp

+ 5 - 3
rtl/morphos/system.pp

@@ -119,8 +119,7 @@ var
           for i:=oldargvlen to argvlen-1 do
             argv[i]:=nil;
         end;
-      { use realloc to reuse already existing memory }
-      sysreallocmem(argv[idx],len+1);
+      ArgV [Idx] := SysAllocMem (Succ (Len));
     end;
 
 var
@@ -336,7 +335,10 @@ end.
 
 {
   $Log$
-  Revision 1.33  2005-04-03 21:10:59  hajny
+  Revision 1.34  2005-05-10 21:45:08  hajny
+    * fix for potential SIGSEGV during argv allocation
+
+  Revision 1.33  2005/04/03 21:10:59  hajny
     * EOF_CTRLZ conditional define replaced with CtrlZMarksEOF, #26 handling made more consistent (fix for bug 2453)
 
   Revision 1.32  2005/02/14 17:13:30  peter

+ 5 - 4
rtl/watcom/system.pp

@@ -304,9 +304,7 @@ var
        fillchar(argv[oldargvlen],(argvlen-oldargvlen)*sizeof(pointer),0);
        argv[idx]:=nil;
      end;
-    { use realloc to reuse already existing memory }
-    if len<>0 then
-      sysreallocmem(argv[idx],len+1);
+     ArgV [Idx] := SysAllocMem (Succ (Len));
   end;
 
 begin
@@ -1541,7 +1539,10 @@ End.
 
 {
   $Log$
-  Revision 1.22  2005-04-13 20:10:50  florian
+  Revision 1.23  2005-05-10 21:45:08  hajny
+    * fix for potential SIGSEGV during argv allocation
+
+  Revision 1.22  2005/04/13 20:10:50  florian
     + TThreadID
 
   Revision 1.21  2005/04/03 21:10:59  hajny