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 vim/vim#1509)  Make option test check all number options with
            empty value.
a12e40351d
This commit is contained in:
Jan Edmund Lazo
2018-09-23 00:52:13 -04:00
parent fe191d95a2
commit bcc174e6df
2 changed files with 14 additions and 1 deletions

View File

@@ -1434,7 +1434,7 @@ do_set (
|| (long *)varp == &p_wcm)
&& (*arg == '<'
|| *arg == '^'
|| ((!arg[1] || ascii_iswhite(arg[1]))
|| (*arg != NUL && (!arg[1] || ascii_iswhite(arg[1]))
&& !ascii_isdigit(*arg)))) {
value = string_to_key(arg);
if (value == 0 && (long *)varp != &p_wcm) {