Mercurial > vim
changeset 16845:d4c50bca8dbc v8.1.1424
patch 8.1.1424: crash when popup menu is deleted while waiting for char
commit https://github.com/vim/vim/commit/5c3fb04623d0260762f1c3c1ba250a407098ff2a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 30 15:53:29 2019 +0200
patch 8.1.1424: crash when popup menu is deleted while waiting for char
Problem: Crash when popup menu is deleted while waiting for char.
Solution: Bail out when pum_array was cleared.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 May 2019 16:00:07 +0200 |
parents | 536acf59c727 |
children | 339949bc111a |
files | src/popupmnu.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -1302,7 +1302,10 @@ pum_show_popupmenu(vimmenu_T *menu) out_flush(); c = vgetc(); - if (c == ESC || c == Ctrl_C) + + // Bail out when typing Esc, CTRL-C or some callback closed the popup + // menu. + if (c == ESC || c == Ctrl_C || pum_array == NULL) break; else if (c == CAR || c == NL) {