patch 8.2.1910: reading past the end of the command line
Problem: Reading past the end of the command line.
Solution: Check for NUL. (closes #7204)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 5e9eeb7..97d4b42 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2958,8 +2958,7 @@
cmod->cmod_save_ei = NULL;
}
- if (cmod->cmod_filter_regmatch.regprog != NULL)
- vim_regfree(cmod->cmod_filter_regmatch.regprog);
+ vim_regfree(cmod->cmod_filter_regmatch.regprog);
if (cmod->cmod_save_msg_silent > 0)
{
@@ -4696,6 +4695,8 @@
{
p += 2;
(void)skip_expr(&p, NULL);
+ if (*p == NUL) // stop at NUL after CTRL-V
+ break;
}
#endif