vim-patch:8.2.4975: recursive command line loop may cause a crash (#18614)

Problem:    Recursive command line loop may cause a crash.
Solution:   Limit recursion of getcmdline().
51f0bfb88a

Cherry-pick e_command_too_recursive from patch 8.2.3957.
This commit is contained in:
zeertzjq
2022-05-18 08:21:24 +08:00
committed by GitHub
parent 38cbca3eea
commit 7ded303d68
4 changed files with 24 additions and 4 deletions

View File

@@ -345,7 +345,7 @@ int do_cmdline(char *cmdline, LineGetter fgetline, void *cookie, int flags)
// here. The value of 200 allows nested function calls, ":source", etc.
// Allow 200 or 'maxfuncdepth', whatever is larger.
if (call_depth >= 200 && call_depth >= p_mfd) {
emsg(_("E169: Command too recursive"));
emsg(_(e_command_too_recursive));
// When converting to an exception, we do not include the command name
// since this is not an error of the specific command.
do_errthrow((cstack_T *)NULL, NULL);