Skip to content

Commit

Permalink
Do not allow escaping the subprojects directory.
Browse files Browse the repository at this point in the history
Fixes #2306
  • Loading branch information
narendravardi authored and jpakkane committed Oct 19, 2017
1 parent fd86048 commit 6083eb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mesonbuild/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,8 @@ def func_subproject(self, nodes, args, kwargs):
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)
Expand Down

0 comments on commit 6083eb2

Please sign in to comment.