mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
CALLF Stack validation height
CALLF should use the target function data when checking stack overflow.
This commit is contained in:
parent
71528b30a4
commit
28db438a8e
1 changed files with 2 additions and 2 deletions
|
|
@ -809,9 +809,9 @@ func opCallf(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
|
||||||
var (
|
var (
|
||||||
code = scope.Contract.CodeAt(scope.CodeSection)
|
code = scope.Contract.CodeAt(scope.CodeSection)
|
||||||
idx = binary.BigEndian.Uint16(code[*pc+1:])
|
idx = binary.BigEndian.Uint16(code[*pc+1:])
|
||||||
typ = scope.Contract.Container.Types[scope.CodeSection]
|
typ = scope.Contract.Container.Types[idx]
|
||||||
)
|
)
|
||||||
if scope.Stack.len()+int(typ.MaxStackHeight) >= 1024 {
|
if scope.Stack.len()+int(typ.MaxStackHeight)-int(typ.Input) > 1024 {
|
||||||
return nil, fmt.Errorf("stack overflow")
|
return nil, fmt.Errorf("stack overflow")
|
||||||
}
|
}
|
||||||
if len(scope.ReturnStack) > 1024 {
|
if len(scope.ReturnStack) > 1024 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue