when shipping, barnReceive can revert in underflow causing dos
In the above snippet we are updating s.sys.fert.leftoverBeans
. The problem occurs when an underflow happens in this calculation due to amountToFertalize
< deltaFertalized
. Because of the underflow, the call will revert and will cause a DOS.
Becuase this snippet is part of the barnReceive function, the dos will be on the receiving of beans. Therefore the beans will not be able to be received because of this underflow.
the deltaFertalized is computed below:
and may be greater than amountToFertilize
Underflow will cause the tx to revert and not allow the receiving of beans to the contract. DOS
manual review
ensure that deltaFertalized
can never be large than amountToFertalize
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.