validate input before calling evm

This commit is contained in:
jpmsam 2018-06-07 15:45:24 -04:00 committed by Zekun Shi
parent 9249ab3169
commit be8f2f8426
1 changed files with 4 additions and 0 deletions

View File

@ -249,6 +249,10 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
} else {
to = st.to()
}
//if input is empty for the smart contract call, return
if len(data) == 0 {
return nil, new(big.Int), new(big.Int), false, nil
}
ret, st.gas, vmerr = evm.Call(sender, to, data, st.gas, st.value)
}
if vmerr != nil {