Skip to content

Commit feb93c4

Browse files
committed
src: guard against nullptr deref in TimerWrapHandle::Stop
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>
1 parent 3f455cb commit feb93c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/timer_wrap.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ TimerWrapHandle::TimerWrapHandle(
5656
}
5757

5858
void TimerWrapHandle::Stop() {
59-
return timer_->Stop();
59+
if (timer_ != nullptr)
60+
return timer_->Stop();
6061
}
6162

6263
void TimerWrapHandle::Close() {

0 commit comments

Comments
 (0)