Do not allow escaping the subprojects directory.

Fixes #2306
pull/2515/head
Narendra Vardi 7 years ago committed by Jussi Pakkanen
parent fd860482e5
commit 6083eb29d0
  1. 2
      mesonbuild/interpreter.py

@ -1663,6 +1663,8 @@ class Interpreter(InterpreterBase):
return self.do_subproject(dirname, kwargs) return self.do_subproject(dirname, kwargs)
def do_subproject(self, 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: if dirname in self.subproject_stack:
fullstack = self.subproject_stack + [dirname] fullstack = self.subproject_stack + [dirname]
incpath = ' => '.join(fullstack) incpath = ' => '.join(fullstack)

Loading…
Cancel
Save