Author: tfaber
Date: Fri Apr 25 12:34:17 2014
New Revision: 62965
URL:
http://svn.reactos.org/svn/reactos?rev=62965&view=rev
Log:
[WIN32K]
- Avoid assigning a nonvolatile variable inside a try block. Spotted by Timo.
CORE-8094
Modified:
trunk/reactos/win32ss/user/ntuser/winsta.c
Modified: trunk/reactos/win32ss/user/ntuser/winsta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winsta…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/winsta.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/winsta.c [iso-8859-1] Fri Apr 25 12:34:17 2014
@@ -736,6 +736,9 @@
}
Exit:
+ if (Status == STATUS_SUCCESS && nLength < nDataSize)
+ Status = STATUS_BUFFER_TOO_SMALL;
+
_SEH2_TRY
{
if (nLengthNeeded)
@@ -745,10 +748,7 @@
if (Status == STATUS_SUCCESS)
{
TRACE("Trying to copy data to caller (len = %lu, len needed = %lu)\n",
nLength, nDataSize);
- if (nLength >= nDataSize)
- RtlCopyMemory(pvInformation, pvData, nDataSize);
- else
- Status = STATUS_BUFFER_TOO_SMALL;
+ RtlCopyMemory(pvInformation, pvData, nDataSize);
}
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)