Sanitize arguments to system calls
This commit is contained in:
parent
fc17d6a14d
commit
eab4a8e3e3
1 changed files with 7 additions and 2 deletions
|
@ -175,8 +175,13 @@ class SystemApi():
|
||||||
self.stdout = [""]
|
self.stdout = [""]
|
||||||
self.stderr = [""]
|
self.stderr = [""]
|
||||||
|
|
||||||
def run(self, args):
|
def run(self, args: list[str]):
|
||||||
stream = sub.Popen(args,
|
sanitized_args = []
|
||||||
|
for arg in args:
|
||||||
|
str_arg = str(arg)
|
||||||
|
if str_arg is not "":
|
||||||
|
sanitized_args.append(str_arg.replace("\n", ""))
|
||||||
|
stream = sub.Popen(sanitized_args,
|
||||||
stdout=sub.PIPE,
|
stdout=sub.PIPE,
|
||||||
stderr=sub.PIPE,
|
stderr=sub.PIPE,
|
||||||
text=True,
|
text=True,
|
||||||
|
|
Loading…
Reference in a new issue