[fixed]:解决路径判断的错误 #1304
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ func Unzip(zipFile string, destDir string) ([]string, error) {
|
||||
defer zipReader.Close()
|
||||
|
||||
for _, f := range zipReader.File {
|
||||
if strings.Index(f.Name, "../") > -1 {
|
||||
if strings.Index(f.Name, "..") > -1 {
|
||||
return []string{}, fmt.Errorf("%s 文件名不合法", f.Name)
|
||||
}
|
||||
fpath := filepath.Join(destDir, f.Name)
|
||||
|
||||
Reference in New Issue
Block a user