comparison src/userfunc.c @ 33570:28c2f681ec33 v9.0.2030

patch 9.0.2030: no max callback recursion limit Commit: https://github.com/vim/vim/commit/47510f3d6598a1218958c03ed11337a43b73f48d Author: Christian Brabandt <cb@256bit.org> Date: Sun Oct 15 09:56:16 2023 +0200 patch 9.0.2030: no max callback recursion limit Problem: no max callback recursion limit Solution: bail out, if max call recursion for callback functions has been reached. This checks the 'maxfuncdepth' setting and throws E169 when a callback function recursively calls itself. closes: #13337 closes: #13339 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 15 Oct 2023 10:00:06 +0200
parents 4db948057fa6
children 28605af12602
comparison
equal deleted inserted replaced
33569:9538f4381328 33570:28c2f681ec33
3581 funcexe_T funcexe; 3581 funcexe_T funcexe;
3582 int ret; 3582 int ret;
3583 3583
3584 if (callback->cb_name == NULL || *callback->cb_name == NUL) 3584 if (callback->cb_name == NULL || *callback->cb_name == NUL)
3585 return FAIL; 3585 return FAIL;
3586
3587 if (callback_depth > p_mfd)
3588 {
3589 emsg(_(e_command_too_recursive));
3590 return FAIL;
3591 }
3592
3586 CLEAR_FIELD(funcexe); 3593 CLEAR_FIELD(funcexe);
3587 funcexe.fe_evaluate = TRUE; 3594 funcexe.fe_evaluate = TRUE;
3588 funcexe.fe_partial = callback->cb_partial; 3595 funcexe.fe_partial = callback->cb_partial;
3589 if (callback->cb_partial != NULL) 3596 if (callback->cb_partial != NULL)
3590 { 3597 {