Browse Source

* fixed potential buffer overflow in GetDir()

git-svn-id: branches/i8086@24080 -
nickysn 12 years ago
parent
commit
efa90dd1f3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      rtl/msdos/sysdir.inc

+ 3 - 1
rtl/msdos/sysdir.inc

@@ -103,7 +103,9 @@ begin
      GetInOutRes (regs.AX);
      Dir := char (DriveNr + 64) + ':\';
      exit;
-   end;
+   end
+  else
+    temp[252] := #0;  { to avoid shortstring buffer overflow }
 { conversion to Pascal string including slash conversion }
   i:=0;
   while (temp[i]<>#0) do