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.stderr = [""]
|
||||
|
||||
def run(self, args):
|
||||
stream = sub.Popen(args,
|
||||
def run(self, args: list[str]):
|
||||
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,
|
||||
stderr=sub.PIPE,
|
||||
text=True,
|
||||
|
|
Loading…
Reference in a new issue