https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dc8bfeabcffeaf2bcdc6907af1313e7a7866314e

commit dc8bfeabcffeaf2bcdc6907af1313e7a7866314e
Author: Pierre Schweitzer <pie...@reactos.org>
AuthorDate: Sat Oct 14 23:19:12 2017 +0200

    [KERNEL32] Use proper size for allocating buffer in 
GetVolumeInformationA(). This was leading to allocate a too small buffer under 
certain conditions and to overrun it.
    This fixes JRE7 setup.
    This regression was brought in by r75969.
    
    CORE-13888
---
 dll/win32/kernel32/client/file/volume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dll/win32/kernel32/client/file/volume.c 
b/dll/win32/kernel32/client/file/volume.c
index e59c291b67..90016b8e08 100644
--- a/dll/win32/kernel32/client/file/volume.c
+++ b/dll/win32/kernel32/client/file/volume.c
@@ -87,7 +87,7 @@ GetVolumeInformationA(IN LPCSTR lpRootPathName,
     /* If caller wants file system name, allocate a buffer to receive it */
     if (lpFileSystemNameBuffer != NULL)
     {
-        FileSystemNameU.MaximumLength = sizeof(WCHAR) * (nVolumeNameSize + 1);
+        FileSystemNameU.MaximumLength = sizeof(WCHAR) * (nFileSystemNameSize + 
1);
         FileSystemNameU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0,
                                                     
FileSystemNameU.MaximumLength);
         if (FileSystemNameU.Buffer == NULL)

Reply via email to