Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-07-21 14:27:07 +0300
committerAnna Henningsen <anna@addaleax.net>2020-07-21 22:11:16 +0300
commitfeb93c4e8425b4fce96d92b6072c6e8b6cc634fd (patch)
tree576a0bf49573903e725988b7daedbd770a01c577 /src/timer_wrap.cc
parent3f455cbddb413caa2f0d1f902d17bc2ea2824a56 (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.cc3
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() {