Skip to content

[Fix] Add zero address validation for onBehalfOf in supply() - #119

Open
AayushJhaAudits wants to merge 1 commit into
aave-dao:mainfrom
AayushJhaAudits:fix/zero-address-check-fix
Open

[Fix] Add zero address validation for onBehalfOf in supply()#119
AayushJhaAudits wants to merge 1 commit into
aave-dao:mainfrom
AayushJhaAudits:fix/zero-address-check-fix

Conversation

@AayushJhaAudits

Copy link
Copy Markdown

Summary

This PR adds a validation check to ensure the onBehalfOf address in the supply() function is not the zero address.

Reasoning

Passing the zero address as onBehalfOf could cause undefined behavior or unintended token assignment.
Adding this check prevents potential misuse or loss of funds.

Code Location

File: src/contracts/protocol/pool/Pool.sol
Function: supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode)

Fix

require(onBehalfOf != address(0), Errors.ZERO_ADDRESS_NOT_VALID);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant