1
0
forked from aniani/vim

patch 8.0.0370: invalid memory access when setting wildchar empty

Problem:    Invalid memory access when setting wildchar empty.
Solution:   Avoid going over the end of the option value. (Dominique Pelle,
            closes #1509)  Make option test check all number options with
            empty value.
This commit is contained in:
Bram Moolenaar
2017-02-25 21:37:57 +01:00
parent c43a8b8de0
commit a12e40351d
4 changed files with 19 additions and 3 deletions

View File

@@ -4612,7 +4612,7 @@ do_set(
|| (long *)varp == &p_wcm)
&& (*arg == '<'
|| *arg == '^'
|| ((!arg[1] || vim_iswhite(arg[1]))
|| (*arg != NUL && (!arg[1] || vim_iswhite(arg[1]))
&& !VIM_ISDIGIT(*arg))))
{
value = string_to_key(arg);
@@ -5843,7 +5843,7 @@ set_string_option(
opt_flags)) == NULL)
did_set_option(opt_idx, opt_flags, TRUE);
/* call autocomamnd after handling side effects */
/* call autocommand after handling side effects */
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (saved_oldval != NULL)
{