Skip to content

Commit 7fa7dfc

Browse files
committed
guard against array bounds panic
1 parent 79e5c28 commit 7fa7dfc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ipfs-3-to-4/migration/migration.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ func transferBlocks(flatfsdir string) error {
345345
return err
346346
}
347347

348+
if len(p) <= len(flatfsdir)+1 {
349+
return nil
350+
}
351+
348352
rel := p[len(flatfsdir)+1:]
349353
if !strings.HasSuffix(rel, ".data") {
350354
fmt.Println("skipping (no .data): ", rel)

0 commit comments

Comments
 (0)