From d58a662f44dc11475f4cf5922a948635da934cc4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 May 2020 14:52:57 +0200 Subject: patch 8.2.0678: rare crash for popup menu Problem: Rare crash for popup menu. Solution: Check for NULL pointer. (Nobuhiro Takasaki, closes #6027) --- src/popupmenu.c | 9 ++++++--- src/version.c | 2 ++ 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 @@ -746,6 +746,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 678, /**/ 677, /**/ -- cgit v1.2.1