aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-06-26 11:59:08 +0200
committerGitHub <noreply@github.com>2019-06-26 11:59:08 +0200
commitac013d7147f13d95ee4ffa4eef6af1023ef0a0c2 (patch)
tree494cd97e17569e6fccec2d1a31a01883f690f354 /src
parent469726d3c5ae2b1db2366625d07f830e68ed1e05 (diff)
parent619a86cb1e8640e4b834ef1f85bd62b0fb5609f2 (diff)
downloadrneovim-ac013d7147f13d95ee4ffa4eef6af1023ef0a0c2.tar.gz
rneovim-ac013d7147f13d95ee4ffa4eef6af1023ef0a0c2.tar.bz2
rneovim-ac013d7147f13d95ee4ffa4eef6af1023ef0a0c2.zip
Merge pull request #10342 from bfredl/apisandbox
eval/api: don't allow the API to be called in the sandbox
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index cd2888883b..ca2f4da22c 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -6669,6 +6669,10 @@ static void float_op_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr)
static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
+ if (check_restricted() || check_secure()) {
+ return;
+ }
+
ApiDispatchWrapper fn = (ApiDispatchWrapper)fptr;
Array args = ARRAY_DICT_INIT;