Skip to content

Commit

Permalink
Fix extract.uncompress crash with unknown file types
Browse files Browse the repository at this point in the history
We should return with an error when the file type is unknown, as we are
not going to be able to process the unknown archive. Trying to do so
would cause a crash.
  • Loading branch information
praveenkumar committed Jul 6, 2020
1 parent 01e7347 commit 6220095
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/extract/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func uncompress(tarball, targetDir string, fileFilter func(string) bool, showPro
case strings.HasSuffix(tarball, ".tar"):
filereader = file
default:
logging.Warnf("Unknown file format when trying to uncompress %s", tarball)
return nil, fmt.Errorf("Unknown file format when trying to uncompress %s", tarball)
}

return untar(filereader, targetDir, fileFilter, showProgress)
Expand Down

0 comments on commit 6220095

Please sign in to comment.