Skip to content

Commit c28d3f1

Browse files
authored
Fix a hardlink cycle detection (#611)
Fixes a hardlink cycle detection.
1 parent c5c1500 commit c28d3f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/ContainerizationEXT4/Formatter+Unpack.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,13 @@ extension Hardlinks {
182182
return nil
183183
}
184184
var next = target
185-
let visited: Set<FilePath> = [next]
185+
var visited: Set<FilePath> = [next]
186186
while let item = self[next] {
187187
if visited.contains(item) {
188188
throw UnpackError.circularLinks
189189
}
190190
next = item
191+
visited.insert(next)
191192
}
192193
return next
193194
}

0 commit comments

Comments
 (0)