Skip to content

Commit

Permalink
fix: prevent out of bounds on lookup inners access
Browse files Browse the repository at this point in the history
  • Loading branch information
crodriguezvega committed Aug 29, 2024
1 parent d98cf6a commit 2c08967
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ func decompressExist(exist *CompressedExistenceProof, lookup []*InnerOp) *Existe
Path: make([]*InnerOp, len(exist.Path)),
}
for i, step := range exist.Path {
res.Path[i] = lookup[step]
if int(step) < len(lookup) {
res.Path[i] = lookup[step]
}
}
return res
}

0 comments on commit 2c08967

Please sign in to comment.