We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 662354a commit b33c236Copy full SHA for b33c236
1 file changed
src/google/adk/tools/environment/_tools.py
@@ -17,6 +17,7 @@
17
from __future__ import annotations
18
19
import logging
20
+import shlex
21
from typing import Any
22
from typing import Optional
23
from typing import TYPE_CHECKING
@@ -187,7 +188,8 @@ async def run_async(
187
188
sed_range = f'{start},{end_line}'
189
else:
190
sed_range = f'{start},$'
- cmd = f"cat -n '{path}' | sed -n '{sed_range}p'"
191
+ safe_path = shlex.quote(path)
192
+ cmd = f"cat -n {safe_path} | sed -n '{sed_range}p'"
193
res = await self._environment.execute(cmd)
194
if res.exit_code == 0:
195
return {'status': 'ok', 'content': _truncate(res.stdout)}
0 commit comments