OSDN Git Service

* dcrt0.cc (insert_file): Fix potential buffer overflow.
authorcorinna <corinna>
Thu, 3 Apr 2008 16:00:14 +0000 (16:00 +0000)
committercorinna <corinna>
Thu, 3 Apr 2008 16:00:14 +0000 (16:00 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc

index 3d788d0..05ca046 100644 (file)
@@ -1,5 +1,9 @@
 2008-04-03  Corinna Vinschen  <corinna@vinschen.de>
 
+       * dcrt0.cc (insert_file): Fix potential buffer overflow.
+
+2008-04-03  Corinna Vinschen  <corinna@vinschen.de>
+
        * path.cc (mount_info::from_fstab): Get module path name of the Cygwin
        DLL, not the path of the application.
 
index cd2ac1e..5464cce 100644 (file)
@@ -165,7 +165,7 @@ insert_file (char *name, char *&cmd)
   tmp_pathbuf tp;
 
   PWCHAR wname = tp.w_get ();
-  sys_mbstowcs (wname, NT_MAX_PATH + 1, name + 1);
+  sys_mbstowcs (wname, NT_MAX_PATH, name + 1);
   f = CreateFileW (wname,
                   GENERIC_READ,         /* open for reading    */
                   FILE_SHARE_READ,      /* share for reading   */