InheritanceManager::removeBeneficiary
improperly deletes an element from the beneficiaries
array, leaving a gap which can lead to unexpected behavior in functions requiring sequential indexing such as unequal funds distribution in InheritanceManager::withdrawInheritedFunds
.InheritanceManager::removeBeneficiary
deletes an element from the beneficiaries array without shifting remaining elements in the array, leaving an empty slot. This causes incorrect indexing.beneficiaries
array may fail due to unintended empty slots or behave not as intended. Unequal funds distribution in InheritanceManager::withdrawInheritedFunds
.InheritanceManager::removeBeneficiary
deletes an element from the beneficiaries array without shifting remaining elements in the array, leaving an empty slot. This causes incorrect indexing, which can lead to unequal distribution of funds in InheritanceManager::withdrawInheritedFunds
.The following test was written, which returned false, proving that other elements in the array were not shifted after one element had been deleted:
delete beneficiaries[indexToRemove];
with a swap-and-pop method, which shifts subsequent elements in the array after one element has been deleted: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.