[NTOS:KE:X64] Zero out the context in KiDispatchException

This commit is contained in:
Timo Kreuzer 2020-01-06 00:51:43 +01:00
parent 637183a12c
commit f66a7e2e48

View file

@ -245,10 +245,13 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
/* Increase number of Exception Dispatches */
KeGetCurrentPrcb()->KeExceptionDispatchCount++;
/* Zero out the context to avoid leaking kernel stack memor to user mode */
RtlZeroMemory(&Context, sizeof(Context));
/* Set the context flags */
Context.ContextFlags = CONTEXT_ALL;
/* Get a Context */
/* Get the Context from the trap and exception frame */
KeTrapFrameToContext(TrapFrame, ExceptionFrame, &Context);
/* Look at our exception code */