diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-07-21 14:27:07 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-07-21 22:11:16 +0300 |
commit | feb93c4e8425b4fce96d92b6072c6e8b6cc634fd (patch) | |
tree | 576a0bf49573903e725988b7daedbd770a01c577 /src/timer_wrap.cc | |
parent | 3f455cbddb413caa2f0d1f902d17bc2ea2824a56 (diff) |
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 <technicalcute@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/timer_wrap.cc')
-rw-r--r-- | src/timer_wrap.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index 4b6350c4cb3..6660b8c9588 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() { |