Author: pschweitzer
Date: Sun Oct 26 21:09:07 2014
New Revision: 65034
URL:
http://svn.reactos.org/svn/reactos?rev=65034&view=rev
Log:
[KERNEL32]
Prevent a use-after-free issue in GetVolumeNameForVolumeMountPointW()
Modified:
trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c
Modified: trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c [iso-8859-1] Sun Oct 26
21:09:07 2014
@@ -118,14 +118,15 @@
NULL, 0, MountDevName, BufferLength);
if (!NT_SUCCESS(Status))
{
- RtlFreeHeap(GetProcessHeap(), 0, MountDevName);
if (Status == STATUS_BUFFER_OVERFLOW)
{
BufferLength = sizeof(MOUNTDEV_NAME) + MountDevName->NameLength;
+ RtlFreeHeap(GetProcessHeap(), 0, MountDevName);
continue;
}
else
{
+ RtlFreeHeap(GetProcessHeap(), 0, MountDevName);
NtClose(FileHandle);
BaseSetLastNTError(Status);
return FALSE;