https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc584bdf9994b8e17034e…
commit bc584bdf9994b8e17034e94a02788a8996aec9e9
Author: Nguyen Trung Khanh <nguyentrungkhanh97(a)gmail.com>
AuthorDate: Sat Aug 15 17:18:35 2020 +0700
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Aug 15 19:18:35 2020 +0900
[NTOS:PS] Fix stack memory disclosure in PsGetContextThread #3024
Fix stack memory disclosure in PsGetContextThread.
---
ntoskrnl/ps/debug.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/ps/debug.c b/ntoskrnl/ps/debug.c
index d87595a8d54..b7ea2db32eb 100644
--- a/ntoskrnl/ps/debug.c
+++ b/ntoskrnl/ps/debug.c
@@ -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;