summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
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/cygwin/path.cc
parent349fba0cb46c289bb8df73dff70e463e13be0b5b (diff)
downloadcygnal-5ede1e7109d64472c66429f1fffcd0f37fa45e0a.tar.gz
cygnal-5ede1e7109d64472c66429f1fffcd0f37fa45e0a.tar.bz2
cygnal-5ede1e7109d64472c66429f1fffcd0f37fa45e0a.zip
* path.cc (fillout_mntent): Fix calculation of unicode buffer size.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 380029cf0..2374c1cb7 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. */