Skip to content

Commit a738a0f

Browse files
Potential fix for code scanning alert no. 553: Log Injection
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 935afec commit a738a0f

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 = [linter.replace('\n', '').replace('\r', '') for linter in args.linter]
774+
LOG.error("Invalid linter choice: %s", sanitized_linter)
774775
sys.exit(1)
775776

776777
sarif_runs: List[dict] = []

0 commit comments

Comments
 (0)