OSDN Git Service

* fhandler.cc (fhandler_disk_file::fstat): Allocate enough space for root dir
authorcgf <cgf>
Sat, 8 Apr 2000 04:47:15 +0000 (04:47 +0000)
committercgf <cgf>
Sat, 8 Apr 2000 04:47:15 +0000 (04:47 +0000)
determination or overflow an array.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler.cc

index 41454f1..92e8ab8 100644 (file)
@@ -1,3 +1,8 @@
+Sat Apr  8 00:46:14 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * fhandler.cc (fhandler_disk_file::fstat): Allocate enough space for
+       root dir determination or overflow an array.
+
 Sat Apr  8 00:08:53 2000  Christopher Faylor <cgf@cygnus.com>
 
        * exceptions.cc (sigsave): Copy on fork so that we can restore correct
index d33b60c..1003815 100644 (file)
@@ -887,8 +887,9 @@ fhandler_disk_file::fstat (struct stat *buf)
   buf->st_dev     = local.dwVolumeSerialNumber;
   buf->st_size    = local.nFileSizeLow;
 
-  /* Allocate some place to determine the root directory. */
-  char root[strlen (get_win32_name ()) + 1];
+  /* Allocate some place to determine the root directory. Need to allocate
+     enough so that rootdir can add a trailing slash if path starts with \\. */
+  char root[strlen (get_win32_name ()) + 3];
   strcpy (root, get_win32_name ());
 
   /* Assume that if a drive has ACL support it MAY have valid "inodes".