Skip to content

Commit

Permalink
fix ecrecover pass invalid params lead to core
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyShi22 committed Jan 10, 2024
1 parent f3922dd commit dbe78bb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions bcos-executor/src/vm/HostContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,18 @@ evmc_result HostContext::callBuiltInPrecompiled(
{
callResults->gas = _request->gas - gasUsed;
}
auto [success, output] =
m_executive->executeOriginPrecompiled(_request->receiveAddress, ref(_request->data));
resultCode =
(int32_t)(success ? TransactionStatus::None : TransactionStatus::RevertInstruction);
resultData.swap(output);
try
{
auto [success, output] = m_executive->executeOriginPrecompiled(
_request->receiveAddress, ref(_request->data));
resultCode =
(int32_t)(success ? TransactionStatus::None : TransactionStatus::RevertInstruction);
resultData.swap(output);
}
catch (...)
{
resultCode = (int32_t)TransactionStatus::RevertInstruction;
}
}
else
{
Expand Down

0 comments on commit dbe78bb

Please sign in to comment.