summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-04 16:15:58 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-04 16:15:58 +0100
commitd1510ee9469f623c872a18b6e3c3666c0fb23c58 (patch)
tree0467d12c3f6ecf15f7402fa3e2d43298fa597c5c /src/ex_docmd.c
parentcef1270dec61efb3544f26ceea0f6a4f57e0198a (diff)
downloadvim-git-d1510ee9469f623c872a18b6e3c3666c0fb23c58.tar.gz
patch 8.2.2299: Vim9: invalid memory access making error message flakyv8.2.2299
Problem: Vim9: invalid memory access making error message flaky. Solution: Do not check cmd_argt for CMD_USER. (issue #7467)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 044c18a85..5a3a37abc 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2025,7 +2025,7 @@ do_one_cmd(
if (p == NULL)
{
if (!ea.skip)
- errormsg = _("E464: Ambiguous use of user-defined command");
+ errormsg = _(e_ambiguous_use_of_user_defined_command);
goto doend;
}
// Check for wrong commands.
@@ -3531,9 +3531,11 @@ find_ex_command(
eap->cmdidx = CMD_finally;
#ifdef FEAT_EVAL
- if (eap->cmdidx != CMD_SIZE && in_vim9script()
+ if (eap->cmdidx < CMD_SIZE
+ && in_vim9script()
&& !IS_WHITE_OR_NUL(*p) && *p != '\n' && *p != '!'
- && (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0)
+ && (eap->cmdidx < 0 ||
+ (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0))
{
semsg(_(e_command_not_followed_by_white_space_str), eap->cmd);
eap->cmdidx = CMD_SIZE;