]> granicus.if.org Git - vim/commitdiff
patch 8.2.1289: crash when using a custom completion function v8.2.1289
authorBram Moolenaar <Bram@vim.org>
Sat, 25 Jul 2020 12:11:55 +0000 (14:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 25 Jul 2020 12:11:55 +0000 (14:11 +0200)
Problem:    Crash when using a custom completion function.
Solution:   Initialize all of the expand_T. (closes #6532)

src/cmdexpand.c
src/version.c

index a10fff8b3d0df2b3a46f43358dfe29d72d8ec391..fe82ab7d4ae8520adfca367860af6f30cfbb3a46 100644 (file)
@@ -494,18 +494,9 @@ ExpandOne(
     void
 ExpandInit(expand_T *xp)
 {
-    xp->xp_pattern = NULL;
-    xp->xp_pattern_len = 0;
+    CLEAR_POINTER(xp);
     xp->xp_backslash = XP_BS_NONE;
-#ifndef BACKSLASH_IN_FILENAME
-    xp->xp_shell = FALSE;
-#endif
     xp->xp_numfiles = -1;
-    xp->xp_files = NULL;
-#if defined(FEAT_EVAL)
-    xp->xp_arg = NULL;
-#endif
-    xp->xp_line = NULL;
 }
 
 /*
@@ -2425,7 +2416,7 @@ expand_shellcmd(
 # if defined(FEAT_EVAL)
 /*
  * Call "user_expand_func()" to invoke a user defined Vim script function and
- * return the result (either a string or a List).
+ * return the result (either a string, a List or NULL).
  */
     static void *
 call_user_expand_func(
index 14044481aa47d491a087c4686963e6b5b2260994..0bd3cb20a3184e76e995e0c4ec00ec90e6c51251 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1289,
 /**/
     1288,
 /**/