From 3e8f9aa31c7cf3df5fb34ebde7b9319fcd948fb0 Mon Sep 17 00:00:00 2001 From: Mir Adnan ALI Date: Tue, 4 Feb 2025 20:32:08 -0500 Subject: [PATCH] fix: Use shlex.quote() to lint filepaths containing shell metacharacters --- aider/linter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/linter.py b/aider/linter.py index 77d9b5eb2..0ddc0bdbd 100644 --- a/aider/linter.py +++ b/aider/linter.py @@ -4,6 +4,7 @@ import subprocess import sys import traceback import warnings +import shlex from dataclasses import dataclass from pathlib import Path @@ -44,7 +45,7 @@ class Linter: return fname def run_cmd(self, cmd, rel_fname, code): - cmd += " " + rel_fname + cmd += " " + shlex.quote(rel_fname) returncode = 0 stdout = ""