aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 44e4e09486..10937879a1 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1253,9 +1253,17 @@ openscript (
EMSG(_(e_nesting));
return;
}
- if (ignore_script)
- /* Not reading from script, also don't open one. Warning message? */
+
+ // Disallow sourcing a file in the sandbox, the commands would be executed
+ // later, possibly outside of the sandbox.
+ if (check_secure()) {
return;
+ }
+
+ if (ignore_script) {
+ // Not reading from script, also don't open one. Warning message?
+ return;
+ }
if (scriptin[curscript] != NULL) /* already reading script */
++curscript;