Sanitize arguments to system calls

merge-requests/6/merge
erik 1 year ago
parent fc17d6a14d
commit eab4a8e3e3

@ -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…
Cancel
Save