aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-08-10 16:47:26 +0000
committerCorinna Vinschen <corinna@vinschen.de>2007-08-10 16:47:26 +0000
commit5ede1e7109d64472c66429f1fffcd0f37fa45e0a (patch)
tree3471e088de952104b86d9f171db1747c57e88996 /winsup
parent349fba0cb46c289bb8df73dff70e463e13be0b5b (diff)
downloadnewlib-5ede1e7109d64472c66429f1fffcd0f37fa45e0a.zip
newlib-5ede1e7109d64472c66429f1fffcd0f37fa45e0a.tar.gz
newlib-5ede1e7109d64472c66429f1fffcd0f37fa45e0a.tar.bz2
* path.cc (fillout_mntent): Fix calculation of unicode buffer size.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/path.cc3
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7b158b1..dcef6f8 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2007-08-10 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (fillout_mntent): Fix calculation of unicode buffer size.
+
+2007-08-10 Corinna Vinschen <corinna@vinschen.de>
+
* syscalls.cc (rename): Check oldpath and newpath for trailing dir
separators, require them to be existing directories if so. Check
for a request to change only the case of the filename. Check paths
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 380029c..2374c1c 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2625,7 +2625,8 @@ fillout_mntent (const char *native_path, const char *posix_path, unsigned flags)
fs_info mntinfo;
UNICODE_STRING unat;
- size_t size = (strlen (native_path) + 1) * sizeof (WCHAR);
+ /* Size must allow prepending the native NT path prefixes. */
+ size_t size = (strlen (native_path) + 10) * sizeof (WCHAR);
RtlInitEmptyUnicodeString (&unat, (PWSTR) alloca (size), size);
get_nt_native_path (native_path, unat);
mntinfo.update (&unat, true); /* this pulls from a cache, usually. */