]> granicus.if.org Git - vim/commitdiff
patch 8.2.0678: rare crash for popup menu v8.2.0678
authorBram Moolenaar <Bram@vim.org>
Sat, 2 May 2020 12:52:57 +0000 (14:52 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 May 2020 12:52:57 +0000 (14:52 +0200)
Problem:    Rare crash for popup menu.
Solution:   Check for NULL pointer. (Nobuhiro Takasaki, closes #6027)

src/popupmenu.c
src/version.c

index b267ec54afa7ba69d0ed5a98b5a67ac8ffadd6ec..d6993dc433ebc96b73797f2f8a6f4b9a1a213402 100644 (file)
@@ -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;
index 8f1539a683db3bee1d110796b776a11d53a5b8e2..29763f7f5decd484b5dc87272d860549ff9e5988 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    678,
 /**/
     677,
 /**/