Skip to content

Commit

Permalink
src: guard against nullptr deref in TimerWrapHandle::Stop
Browse files Browse the repository at this point in the history
Refs: #34454

PR-URL: #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>
  • Loading branch information
addaleax authored and targos committed May 1, 2021
1 parent cf2475c commit b1d5160
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/timer_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ TimerWrapHandle::TimerWrapHandle(
}

void TimerWrapHandle::Stop() {
return timer_->Stop();
if (timer_ != nullptr)
return timer_->Stop();
}

void TimerWrapHandle::Close() {
Expand Down

0 comments on commit b1d5160

Please sign in to comment.