mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 09:19:43 +10:00
Usually, terminal_close() calls refresh_terminal(), which allocates the scrollback buffer, and term_may_alloc_scrollback() in terminal_open() won't dereference the buffer. However, refresh_terminal() is not called during Nvim exit, in which case a heap-use-after-free may happen if TermOpen wipes buffer. Check for non-NULL buf_handle to avoid that.