From 218c887878d331ea8c46f6b7930925e04c742cf0 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 28 Jun 2024 10:37:48 +0200 Subject: [PATCH] core/vm: fix opExt{*}Call address space extension --- core/vm/eips.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/vm/eips.go b/core/vm/eips.go index 71ed4785a2..4dcee8a56c 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -1130,6 +1130,9 @@ func opExtDelegateCall(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCont // Pop other call parameters. addr, inOffset, inSize := stack.pop(), stack.pop(), stack.pop() toAddr := common.Address(addr.Bytes20()) + if addr.ByteLen() > 20 { + return nil, errors.New("address space extension") + } // safe a memory alloc temp := addr // Get arguments from the memory. @@ -1173,6 +1176,9 @@ func opExtStaticCall(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContex // Pop other call parameters. addr, inOffset, inSize := stack.pop(), stack.pop(), stack.pop() toAddr := common.Address(addr.Bytes20()) + if addr.ByteLen() > 20 { + return nil, errors.New("address space extension") + } // safe a memory alloc temp := addr // Get arguments from the memory.