Closed guidovranken closed 8 months ago
call.promise_count() can be 0, in which case call.promise_count() - 1 causes a subtraction underflow:
call.promise_count()
call.promise_count() - 1
https://github.com/aurora-is-near/aurora-engine/blob/1213f2c7c035aa523601fced8f75bef61b4728ab/engine-precompiles/src/xcc.rs#L141
This PR makes the function return to caller with an error if (and only if) this is the case.
Fuzzing.
Probably this PR should be merged after #885.
Description
call.promise_count()
can be 0, in which casecall.promise_count() - 1
causes a subtraction underflow:https://github.com/aurora-is-near/aurora-engine/blob/1213f2c7c035aa523601fced8f75bef61b4728ab/engine-precompiles/src/xcc.rs#L141
This PR makes the function return to caller with an error if (and only if) this is the case.
Performance / NEAR gas cost considerations
Testing
Fuzzing.
How should this be reviewed
Additional information