From 5bfc68cc14a4fd157f5f6df716648ac67542e528 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 15 Oct 2017 10:43:49 +0200 Subject: [PATCH] [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 90016b8e086..ba0ef82f5dd 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)) {