jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/0001-patch-8.1.1365-source-command-doesn-t-check-for-the-.patch

6646c7
diff -up vim80/src/getchar.c.cve vim80/src/getchar.c
6646c7
--- vim80/src/getchar.c.cve	2019-06-14 13:46:17.269523985 +0200
6646c7
+++ vim80/src/getchar.c	2019-06-14 13:46:58.427169288 +0200
6646c7
@@ -1418,6 +1418,12 @@ openscript(
6646c7
 	EMSG(_(e_nesting));
6646c7
 	return;
6646c7
     }
6646c7
+
6646c7
+    // Disallow sourcing a file in the sandbox, the commands would be executed
6646c7
+    // later, possibly outside of the sandbox.
6646c7
+    if (check_secure())
6646c7
+	return;
6646c7
+
6646c7
 #ifdef FEAT_EVAL
6646c7
     if (ignore_script)
6646c7
 	/* Not reading from script, also don't open one.  Warning message? */