diff src/terminal.c @ 13547:87a9c1be0ae3 v8.0.1647

patch 8.0.1647: terminal API may call any user function commit https://github.com/vim/vim/commit/2a77d21f7893ba14e682a3c5891d606f117a3f36 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 26 21:38:52 2018 +0200 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_.
author Christian Brabandt <cb@256bit.org>
date Mon, 26 Mar 2018 21:45:07 +0200
parents e9ffb5b35266
children 4911058c43eb
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -3193,7 +3193,7 @@ handle_call_command(term_T *term, channe
     }
     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;