Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions storage/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,9 @@ func (m *MigrationStorage) fetchLeafHashes(ctx context.Context, from, to, source
if err != nil {
return fmt.Errorf("bundleHasherFunc for bundle index %d: %v", ri.Index, err)
}
if l := len(bh); l < int(ri.First+ri.N) {
return fmt.Errorf("bundle index %d has fewer entries than expected (%d < %d)", ri.Index, l, ri.First+ri.N)
}
toBeAdded.Store(ri.Index, bh[ri.First:ri.First+ri.N])
return nil
})
Expand Down
3 changes: 3 additions & 0 deletions storage/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,9 @@ func (m *MigrationStorage) fetchLeafHashes(ctx context.Context, from, to, source
if err != nil {
return fmt.Errorf("bundleHasherFunc for bundle index %d: %v", ri.Index, err)
}
if l := len(bh); l < int(ri.First+ri.N) {
return fmt.Errorf("bundle index %d has fewer entries than expected (%d < %d)", ri.Index, l, ri.First+ri.N)
}
toBeAdded.Store(ri.Index, bh[ri.First:ri.First+ri.N])
return nil
})
Expand Down
3 changes: 3 additions & 0 deletions storage/posix/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,9 @@ func (m *MigrationStorage) fetchLeafHashes(ctx context.Context, from, to, source
if err != nil {
return nil, fmt.Errorf("bundleHasherFunc for bundle index %d: %v", ri.Index, err)
}
if l := len(bh); l < int(ri.First+ri.N) {
return nil, fmt.Errorf("bundle index %d has fewer entries than expected (%d < %d)", ri.Index, l, ri.First+ri.N)
}
lh = append(lh, bh[ri.First:ri.First+ri.N]...)
n++
if n >= maxBundles {
Expand Down
Loading