* path.cc (fillout_mntent): Fix calculation of unicode buffer size.

This commit is contained in:
Corinna Vinschen 2007-08-10 16:47:26 +00:00
parent 349fba0cb4
commit 5ede1e7109
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -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. */