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.
diff --git a/src/option.c b/src/option.c
index 5a8af31..d948ac6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4612,7 +4612,7 @@
|| (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 @@
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)
{