Skip to content

Commit

Permalink
fix: infinite loop when calling extcodecopy on empty code (ethereum#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet authored Mar 6, 2023
1 parent ecf1a20 commit 61bbf38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func touchEachChunksOnReadAndChargeGas(offset, size uint64, contract *Contract,
// reason that we do not need the last leaf is the account's code size
// is already in the AccessWitness so a stateless verifier can see that
// the code from the last leaf is not needed.
if code != nil && (size == 0 || offset > uint64(len(code))) {
if len(code) == 0 && size == 0 || offset > uint64(len(code)) {
return 0
}
var (
Expand Down

0 comments on commit 61bbf38

Please sign in to comment.