Skip to content

Commit 7ad9431

Browse files
authored
Merge pull request #21 from advanced-security/alert-autofix-553
Potential fix for code scanning alert no. 553: Log Injection
2 parents 935afec + 0e157c7 commit 7ad9431

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python_lint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,8 @@ def main() -> None:
770770
logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)
771771

772772
if any({linter not in LINTERS for linter in args.linter}):
773-
LOG.error("Invalid linter choice: %s", args.linter)
773+
sanitized_linter = [re.sub(r'[\x00-\x1F]', '', linter) for linter in args.linter]
774+
LOG.error("Invalid linter choice: %s", ', '.join(sanitized_linter))
774775
sys.exit(1)
775776

776777
sarif_runs: List[dict] = []

0 commit comments

Comments
 (0)