Merge pull request #10569 from filecoin-project/fix/panic-index-oor

fix: proving: Initialize slice with with same length as partition
This commit is contained in:
Łukasz Magiera 2023-03-27 13:03:42 +02:00 committed by GitHub
commit 2120fae2b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -658,6 +658,10 @@ It will not send any messages to the chain.`,
for _, i := range res {
var postParam SubmitWindowedPoStParams
postParam.Deadline = i.Deadline
// Initialize the postParam.Partitions slice with the same length as i.Partitions
postParam.Partitions = make([]PoStPartition, len(i.Partitions))
for id, part := range i.Partitions {
postParam.Partitions[id].Index = part.Index
count, err := part.Skipped.Count()