summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-02 14:52:57 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-02 14:52:57 +0200
commitd58a662f44dc11475f4cf5922a948635da934cc4 (patch)
treebb7147c77e37fbc982bb23804b19eb694f23704a
parentc8cd2b34d1027c93fbca90f3cdc8123fe22dfa25 (diff)
downloadvim-git-d58a662f44dc11475f4cf5922a948635da934cc4.tar.gz
patch 8.2.0678: rare crash for popup menuv8.2.0678
Problem: Rare crash for popup menu. Solution: Check for NULL pointer. (Nobuhiro Takasaki, closes #6027)
-rw-r--r--src/popupmenu.c9
-rw-r--r--src/version.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/popupmenu.c b/src/popupmenu.c
index b267ec54a..d6993dc43 100644
--- 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
index 8f1539a68..29763f7f5 100644
--- 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,