]> git.meshlink.io Git - meshlink/commit
Avoid a segfault when setting a timeout to 0.
authorGuus Sliepen <guus@meshlink.io>
Tue, 28 Apr 2020 21:19:29 +0000 (23:19 +0200)
committerGuus Sliepen <guus@meshlink.io>
Tue, 28 Apr 2020 21:19:29 +0000 (23:19 +0200)
commitf83d168f21b87170b5b02357c378c4b819080369
tree9459e5bb668bbf3c903af347b196ff14ee55c30f
parentf3e15df2c965d014a3281416e502be96170063e8
Avoid a segfault when setting a timeout to 0.

The event loop was assuming that a timespec value of {0, 0} meant that the
timer was not added to the timer tree. However, it was possible for other
parts of the code to set the value to {0, 0}, which could result in a
segmentation fault. Use the splay_node_t data pointer to check whether a
timeout is linked into the tree instead.
src/event.c