Skip to content

Commit

Permalink
accounts/abi: avoid unnecessary alloc (#24128)
Browse files Browse the repository at this point in the history
  • Loading branch information
fomotrader committed Dec 20, 2021
1 parent 8bbf83e commit 99be62a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accounts/abi/unpack.go
Expand Up @@ -290,7 +290,7 @@ func tuplePointsTo(index int, output []byte) (start int, err error) {
offset := big.NewInt(0).SetBytes(output[index : index+32])
outputLen := big.NewInt(int64(len(output)))

if offset.Cmp(big.NewInt(int64(len(output)))) > 0 {
if offset.Cmp(outputLen) > 0 {
return 0, fmt.Errorf("abi: cannot marshal in to go slice: offset %v would go over slice boundary (len=%v)", offset, outputLen)
}
if offset.BitLen() > 63 {
Expand Down

0 comments on commit 99be62a

Please sign in to comment.