From 7d1a497619f4001db59e552ddb69406bea4dae70 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 3 Apr 2022 20:10:37 -0400 Subject: [PATCH] [NTOS:EX] Only set WakeTimer-related status if timer handle is valid. CORE-18133 Since STATUS_TIMER_RESUME_IGNORED is a success status, we would otherwise go into the success case with a NULL Timer object pointer. --- ntoskrnl/ex/timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/ex/timer.c b/ntoskrnl/ex/timer.c index 0ce7af03156..0c33675333c 100644 --- a/ntoskrnl/ex/timer.c +++ b/ntoskrnl/ex/timer.c @@ -640,7 +640,10 @@ NtSetTimer(IN HANDLE TimerHandle, * functionality required to support them, make this check dependent * on the actual PM capabilities */ - if (WakeTimer) Status = STATUS_TIMER_RESUME_IGNORED; + if (NT_SUCCESS(Status) && WakeTimer) + { + Status = STATUS_TIMER_RESUME_IGNORED; + } /* Check status */ if (NT_SUCCESS(Status))