# HG changeset patch # User Bram Moolenaar # Date 1588424404 -7200 # Node ID 43ae8e2fd4c452c5d90d9241fb5ea04b74a96cb8 # Parent 23d75968ca5e403050693e50b2ab11b5089bf9f1 patch 8.2.0678: rare crash for popup menu Commit: https://github.com/vim/vim/commit/d58a662f44dc11475f4cf5922a948635da934cc4 Author: Bram Moolenaar Date: Sat May 2 14:52:57 2020 +0200 patch 8.2.0678: rare crash for popup menu Problem: Rare crash for popup menu. Solution: Check for NULL pointer. (Nobuhiro Takasaki, closes https://github.com/vim/vim/issues/6027) diff --git a/src/popupmenu.c b/src/popupmenu.c --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -60,9 +60,12 @@ pum_compute_size(void) pum_extra_width = 0; for (i = 0; i < pum_size; ++i) { - w = vim_strsize(pum_array[i].pum_text); - if (pum_base_width < w) - pum_base_width = w; + if (pum_array[i].pum_text != NULL) + { + w = vim_strsize(pum_array[i].pum_text); + if (pum_base_width < w) + pum_base_width = w; + } if (pum_array[i].pum_kind != NULL) { w = vim_strsize(pum_array[i].pum_kind) + 1; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 678, +/**/ 677, /**/ 676,