0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.0678: rare crash for popup menu

Problem:    Rare crash for popup menu.
Solution:   Check for NULL pointer. (Nobuhiro Takasaki, closes #6027)
This commit is contained in:
Bram Moolenaar
2020-05-02 14:52:57 +02:00
parent c8cd2b34d1
commit d58a662f44
2 changed files with 8 additions and 3 deletions

View File

@@ -59,10 +59,13 @@ pum_compute_size(void)
pum_kind_width = 0; pum_kind_width = 0;
pum_extra_width = 0; pum_extra_width = 0;
for (i = 0; i < pum_size; ++i) for (i = 0; i < pum_size; ++i)
{
if (pum_array[i].pum_text != NULL)
{ {
w = vim_strsize(pum_array[i].pum_text); w = vim_strsize(pum_array[i].pum_text);
if (pum_base_width < w) if (pum_base_width < w)
pum_base_width = w; pum_base_width = w;
}
if (pum_array[i].pum_kind != NULL) if (pum_array[i].pum_kind != NULL)
{ {
w = vim_strsize(pum_array[i].pum_kind) + 1; w = vim_strsize(pum_array[i].pum_kind) + 1;

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
678,
/**/ /**/
677, 677,
/**/ /**/