Skip to content

Commit 4f3bd0b

Browse files
BarbatosBarbatos
authored andcommitted
fix path bug
1 parent a769f83 commit 4f3bd0b

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

tools/trond/utils/http.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,6 @@ func ExtractTgzWithStatus(tgzFile, destDir string) error {
453453

454454
// Target file path
455455
target := filepath.Join(destDir, sanitizedName)
456-
// Ensure the target path is still within the destination directory
457-
if !strings.HasPrefix(target, filepath.Clean(destDir)+string(os.PathSeparator)) {
458-
return fmt.Errorf("attempted directory traversal: %s", header.Name)
459-
}
460456

461457
switch header.Typeflag {
462458
case tar.TypeDir:

0 commit comments

Comments
 (0)