Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
igoogolx committed Jun 22, 2024
1 parent 84195fc commit 68d25f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
)

func main() {
Expand Down Expand Up @@ -109,6 +110,9 @@ func unarchiveFile(archiveFilePath string) error {
if err != nil {
return err
}
if strings.Contains(header.Name, "..") {
return fmt.Errorf("invalid file name: %s", header.Name)
}
outputPath := filepath.Join(parentDir, header.Name)
err = os.RemoveAll(outputPath)
if err != nil {
Expand Down

0 comments on commit 68d25f4

Please sign in to comment.