diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 19874f830d..790f0f7dec 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -768,6 +768,7 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear } init_ccline(s->firstc, s->indent); + assert(ccline.cmdbuff != NULL); ccline.prompt_id = last_prompt_id++; ccline.level = cmdline_level; diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index d386b6dda3..a98c85220a 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -172,10 +172,10 @@ struct terminal { // no way to know if the memory was reused. handle_T buf_handle; bool in_altscreen; - // program exited - bool closed; // program suspended bool suspended; + // program exited + bool closed; // when true, the terminal's destruction is already enqueued. bool destroy; diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 27521610e5..95889eedf9 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -414,6 +414,9 @@ void ui_attach_impl(RemoteUI *ui, uint64_t chanid) void ui_detach_impl(RemoteUI *ui, uint64_t chanid) { + if (ui_count > MAX_UI_COUNT) { + abort(); + } size_t shift_index = MAX_UI_COUNT; // Find the index that will be removed