浏览代码

* fixed potential buffer overflow in GetDir()

git-svn-id: branches/i8086@24080 -
nickysn 12 年之前
父节点
当前提交
efa90dd1f3
共有 1 个文件被更改,包括 3 次插入1 次删除
  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