Ported security fix from https://github.com/bitshares/bitshares-core/pull/591/
This commit is contained in:
parent
86fdba0782
commit
8c0fcf9db8
1 changed files with 3 additions and 6 deletions
|
|
@ -658,13 +658,10 @@ operation_result database::apply_operation(transaction_evaluation_state& eval_st
|
|||
{ try {
|
||||
int i_which = op.which();
|
||||
uint64_t u_which = uint64_t( i_which );
|
||||
if( i_which < 0 )
|
||||
assert( "Negative operation tag" && false );
|
||||
if( u_which >= _operation_evaluators.size() )
|
||||
assert( "No registered evaluator for this operation" && false );
|
||||
FC_ASSERT( i_which >= 0, "Negative operation tag in operation ${op}", ("op",op) );
|
||||
FC_ASSERT( u_which < _operation_evaluators.size(), "No registered evaluator for operation ${op}", ("op",op) );
|
||||
unique_ptr<op_evaluator>& eval = _operation_evaluators[ u_which ];
|
||||
if( !eval )
|
||||
assert( "No registered evaluator for this operation" && false );
|
||||
FC_ASSERT( eval, "No registered evaluator for operation ${op}", ("op",op) );
|
||||
auto op_id = push_applied_operation( op );
|
||||
auto result = eval->evaluate( eval_state, op, true );
|
||||
set_applied_operation_result( op_id, result );
|
||||
|
|
|
|||
Loading…
Reference in a new issue