Mercurial > vim
changeset 21477:8a0362947c3a v8.2.1289
patch 8.2.1289: crash when using a custom completion function
Commit: https://github.com/vim/vim/commit/c841afff6a89592f23710c6da5b0fea89b240937
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 25 14:11:55 2020 +0200
patch 8.2.1289: crash when using a custom completion function
Problem: Crash when using a custom completion function.
Solution: Initialize all of the expand_T. (closes https://github.com/vim/vim/issues/6532)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Jul 2020 14:15:04 +0200 |
parents | 0b980eeee05d |
children | d452597ad7ff |
files | src/cmdexpand.c src/version.c |
diffstat | 2 files changed, 4 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -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(