Skip to content

Commit

Permalink
Fix path resolution issue at code edit tools (#1054)
Browse files Browse the repository at this point in the history
* fix path resolution issue at code edit tools

* bump version
  • Loading branch information
CTY-git authored Dec 5, 2024
1 parent e9b7ee5 commit b778445
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion patchwork/common/tools/code_edit_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def tool_records(self):

def __get_abs_path(self, path: str):
abs_path = (self.repo_path / path.lstrip("/")).resolve()
if not abs_path.is_relative_to(self.repo_path):
if not abs_path.is_relative_to(self.repo_path.resolve()):
raise ValueError(f"Path {path} contains illegal path traversal")

return abs_path
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "patchwork-cli"
version = "0.0.79"
version = "0.0.80"
description = ""
authors = ["patched.codes"]
license = "AGPL"
Expand Down

0 comments on commit b778445

Please sign in to comment.