diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7b158b1eb..dcef6f846 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2007-08-10 Corinna Vinschen + + * path.cc (fillout_mntent): Fix calculation of unicode buffer size. + 2007-08-10 Corinna Vinschen * syscalls.cc (rename): Check oldpath and newpath for trailing dir 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. */