But in the _deleteAddressAtIndexFromArray() instead of adding the removed address addresses[index] to the removedAddresses array, the last address of the profile addresses addresses[addresses.length - 1] is aded to the removedAddresses array, which results in the wrong address getting added to the removed addresses
Impact
The wrong address is getting added to the removedAddresses list and cause errors.
Mitigation
Add the removed address to the removedAddresses array, the corrected implementation would be:
LeFy
High
deleteAddressAtIndex() adds the wrong address to the removedAddresses[] list
Summary
In 'EthosProfile.sol', when user calls the deleteAddressAtIndex(), wrong address is being pushed to the
profiles[profileId].removedAddresses
array.Root Cause
When a user wants to delete an address from the profile, the deleteAddressAtIndex() is called.
Repo Link
Repo Link
But in the _deleteAddressAtIndexFromArray() instead of adding the removed address
addresses[index]
to theremovedAddresses
array, the last address of the profile addressesaddresses[addresses.length - 1]
is aded to theremovedAddresses
array, which results in the wrong address getting added to the removed addressesImpact
The wrong address is getting added to the removedAddresses list and cause errors.
Mitigation
Add the removed address to the removedAddresses array, the corrected implementation would be: