From 2a77d21f7893ba14e682a3c5891d606f117a3f36 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 26 Mar 2018 21:38:52 +0200 Subject: 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_. --- src/terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/terminal.c') diff --git a/src/terminal.c b/src/terminal.c index 50e87c9e4..5875af6e6 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -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; -- cgit v1.2.1