From 6083eb29d0d5d81510a588dc64f5533ef58bb8e0 Mon Sep 17 00:00:00 2001 From: Narendra Vardi Date: Sun, 15 Oct 2017 21:51:43 +0530 Subject: [PATCH] Do not allow escaping the subprojects directory. Fixes #2306 --- mesonbuild/interpreter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index bfd946aeb..e385a886a 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1663,6 +1663,8 @@ class Interpreter(InterpreterBase): return self.do_subproject(dirname, kwargs) def do_subproject(self, dirname, kwargs): + if '/' in dirname or '\\' in dirname: + raise InterpreterException('Subproject name must not contain a path separator.') if dirname in self.subproject_stack: fullstack = self.subproject_stack + [dirname] incpath = ' => '.join(fullstack)