aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2015-04-03 12:35:12 -0400
committerScott Prager <splinterofchaos@gmail.com>2015-04-08 23:18:16 -0400
commit93a3e331a3e266b17115824f8f79dd296962de21 (patch)
tree908b674361d62b864254dacad4f3af6b1b80db2e /src
parentedbc9e6538daab972058bb8a821330eabbba954f (diff)
downloadrneovim-93a3e331a3e266b17115824f8f79dd296962de21.tar.gz
rneovim-93a3e331a3e266b17115824f8f79dd296962de21.tar.bz2
rneovim-93a3e331a3e266b17115824f8f79dd296962de21.zip
event: Only process if event_init has been run.
Reported by @fourjay, a codepath that causes event_poll() to run before event_init() will trigger a segfault as the events list will not have been initialized. Exiting immediately from event_init() causes nvim to hang, so just exit before running the events. fixes #2339
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/event.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/os/event.c b/src/nvim/os/event.c
index 9bc509bb16..dbb9d337cf 100644
--- a/src/nvim/os/event.c
+++ b/src/nvim/os/event.c
@@ -124,7 +124,11 @@ void event_poll(int ms)
}
recursive--; // Can re-enter uv_run now
- process_events_from(immediate_events);
+
+ // In case this is run before event_init, don't process any events.
+ if (immediate_events) {
+ process_events_from(immediate_events);
+ }
}
bool event_has_deferred(void)