mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Fix a bunch of scanning / tagging bugs (#3154)
* Fix possible infinite loop/stack overflow with weird/broken zip files * Fix path length calculation using bytes instead of characters (runes) * Fix bug where oshash gets buffers with size not actually multiple of 8 * Add oshash tests Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -125,7 +125,12 @@ func walkDir(f FS, path string, d fs.DirEntry, walkDirFn fs.WalkDirFunc) error {
|
||||
}
|
||||
|
||||
for _, d1 := range dirs {
|
||||
path1 := filepath.Join(path, d1.Name())
|
||||
name := d1.Name()
|
||||
// Prevent infinite loops; this can happen with certain FS implementations (e.g. ZipFS).
|
||||
if name == "" || name == "." {
|
||||
continue
|
||||
}
|
||||
path1 := filepath.Join(path, name)
|
||||
if err := walkDir(f, path1, d1, walkDirFn); err != nil {
|
||||
if errors.Is(err, fs.SkipDir) {
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user