fix(lint): lint fixed2
This commit is contained in:
parent
ece572761f
commit
2ec14266fd
1 changed files with 2 additions and 1 deletions
|
|
@ -550,7 +550,8 @@ func extractTarFromReader(tr *tar.Reader, destDir string) error {
|
|||
return err
|
||||
}
|
||||
target := filepath.Clean(filepath.Join(filepath.Clean(destDir), hdr.Name))
|
||||
if !strings.HasPrefix(target, filepath.Clean(destDir)+string(os.PathSeparator)) && target != filepath.Clean(destDir) {
|
||||
if !strings.HasPrefix(target, filepath.Clean(destDir)+string(os.PathSeparator)) &&
|
||||
target != filepath.Clean(destDir) {
|
||||
return fmt.Errorf("path traversal detected: %s", hdr.Name)
|
||||
}
|
||||
switch hdr.Typeflag {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue