[NTOS:PS] Fix stack memory disclosure in PsGetContextThread #3024

Fix stack memory disclosure in PsGetContextThread.
This commit is contained in:
Nguyen Trung Khanh 2020-08-15 17:18:35 +07:00 committed by GitHub
parent 49be08bc69
commit bc584bdf99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,7 +112,7 @@ PsGetContextThread(IN PETHREAD Thread,
/* Enter SEH */
_SEH2_TRY
{
/* Set default ength */
/* Set default length */
Size = sizeof(CONTEXT);
/* Read the flags */
@ -146,6 +146,7 @@ PsGetContextThread(IN PETHREAD Thread,
KeInitializeEvent(&GetSetContext.Event, NotificationEvent, FALSE);
/* Set the flags and previous mode */
RtlZeroMemory(&GetSetContext.Context, Size);
GetSetContext.Context.ContextFlags = Flags;
GetSetContext.Mode = PreviousMode;