Skip to content

Commit

Permalink
In our image header.Name cannot contain ..
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Oct 13, 2023
1 parent b5e5a56 commit a85e218
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/archive/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ func ExtractTarGz(gzipStream io.Reader) error {
return fmt.Errorf("ExtractTarGz: Next() failed: %s", err.Error())
}

// TODO: Check if this is really necessary
//if strings.Contains(header.Name, "..") {
// return fmt.Errorf("ExtractTarGz: filename contains '..': %s", header.Name)
//}
if strings.Contains(header.Name, "..") {
return fmt.Errorf("ExtractTarGz: filename contains '..': %s", header.Name)
}

switch header.Typeflag {
case tar.TypeDir:
Expand Down

0 comments on commit a85e218

Please sign in to comment.