https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5bfc68cc14a4fd157f5f6…
commit 5bfc68cc14a4fd157f5f6df716648ac67542e528
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Oct 15 10:43:49 2017 +0200
[KERNEL32] Fix buffer size for allocation in GetVolumeInformationW(). This fixes
function failing with big enough buffer.
---
dll/win32/kernel32/client/file/volume.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dll/win32/kernel32/client/file/volume.c
b/dll/win32/kernel32/client/file/volume.c
index 90016b8e08..ba0ef82f5d 100644
--- a/dll/win32/kernel32/client/file/volume.c
+++ b/dll/win32/kernel32/client/file/volume.c
@@ -253,6 +253,10 @@ GetVolumeInformationW(IN LPCWSTR lpRootPathName,
RootPathName = lpRootPathName;
}
+ /* Convert length to bytes */
+ nVolumeNameSize *= sizeof(WCHAR);
+ nFileSystemNameSize *= sizeof(WCHAR);
+
/* Convert to NT name */
if (!RtlDosPathNameToNtPathName_U(RootPathName, &NtPathName, NULL, NULL))
{