From fe69e1ef6b1a9753b2cd6c89cddf6565fa3ac776 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 21 Jul 2020 13:27:07 +0200 Subject: [PATCH] src: guard against nullptr deref in TimerWrapHandle::Stop Refs: https://github.com/nodejs/node/pull/34454 PR-URL: https://github.com/nodejs/node/pull/34460 Reviewed-By: Jiawen Geng Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: David Carlier --- src/timer_wrap.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index 4b6350c4cb33b5..6660b8c958810c 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -56,7 +56,8 @@ TimerWrapHandle::TimerWrapHandle( } void TimerWrapHandle::Stop() { - return timer_->Stop(); + if (timer_ != nullptr) + return timer_->Stop(); } void TimerWrapHandle::Close() {