changeset 20245:43ae8e2fd4c4 v8.2.0678

patch 8.2.0678: rare crash for popup menu Commit: https://github.com/vim/vim/commit/d58a662f44dc11475f4cf5922a948635da934cc4 Author: Bram Moolenaar <Bram@vim.org> 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)
author Bram Moolenaar <Bram@vim.org>
date Sat, 02 May 2020 15:00:04 +0200
parents 23d75968ca5e
children ef2250432801
files src/popupmenu.c src/version.c
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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,