mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 02:37:06 +00:00
NtQuerySystemInformation:
Do not blindly zero the buffer with the size sent in by the caller. This fixes the stack smash "ntdll_winetest info" was seeing. Thanks to arty for catching it. Remove the nested SEH. "ntdll_winetest info" now has 16 failures. svn path=/trunk/; revision=28569
This commit is contained in:
parent
8fd9f85a76
commit
03f90f222d
|
@ -501,6 +501,7 @@ QSI_DEF(SystemBasicInformation)
|
||||||
{
|
{
|
||||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||||
}
|
}
|
||||||
|
RtlZeroMemory(Sbi, Size);
|
||||||
Sbi->Reserved = 0;
|
Sbi->Reserved = 0;
|
||||||
Sbi->TimerResolution = KeMaximumIncrement;
|
Sbi->TimerResolution = KeMaximumIncrement;
|
||||||
Sbi->PageSize = PAGE_SIZE;
|
Sbi->PageSize = PAGE_SIZE;
|
||||||
|
@ -722,6 +723,7 @@ QSI_DEF(SystemProcessInformation)
|
||||||
{
|
{
|
||||||
_SEH_YIELD(return STATUS_INFO_LENGTH_MISMATCH); // in case buffer size is too small
|
_SEH_YIELD(return STATUS_INFO_LENGTH_MISMATCH); // in case buffer size is too small
|
||||||
}
|
}
|
||||||
|
RtlZeroMemory(Spi, Size);
|
||||||
|
|
||||||
syspr = PsGetNextProcess(NULL);
|
syspr = PsGetNextProcess(NULL);
|
||||||
pr = syspr;
|
pr = syspr;
|
||||||
|
@ -1819,9 +1821,6 @@ NtQuerySystemInformation (IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||||
ProbeForWriteUlong(UnsafeResultLength);
|
ProbeForWriteUlong(UnsafeResultLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear user buffer. */
|
|
||||||
RtlZeroMemory(SystemInformation, Length);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check the request is valid.
|
* Check the request is valid.
|
||||||
*/
|
*/
|
||||||
|
@ -1842,15 +1841,7 @@ NtQuerySystemInformation (IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||||
{
|
{
|
||||||
if (PreviousMode != KernelMode)
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
_SEH_TRY
|
|
||||||
{
|
|
||||||
*UnsafeResultLength = ResultLength;
|
*UnsafeResultLength = ResultLength;
|
||||||
}
|
|
||||||
_SEH_EXCEPT(_SEH_ExSystemExceptionFilter)
|
|
||||||
{
|
|
||||||
FStatus = _SEH_GetExceptionCode();
|
|
||||||
}
|
|
||||||
_SEH_END;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue