1
0
forked from aniani/vim

patch 8.0.1647: terminal API may call any user function

Problem:    Terminal API may call a function not meant to be called by this
            API.
Solution:   Require the function to start with Tapi_.
This commit is contained in:
Bram Moolenaar
2018-03-26 21:38:52 +02:00
parent 4368d5ce8a
commit 2a77d21f78
4 changed files with 47 additions and 19 deletions

View File

@@ -3193,7 +3193,7 @@ handle_call_command(term_T *term, channel_T *channel, listitem_T *item)
}
func = get_tv_string(&item->li_tv);
if (!ASCII_ISUPPER(*func))
if (STRNCMP(func, "Tapi_", 5) != 0)
{
ch_log(channel, "Invalid function name: %s", func);
return;