sherlock-audit / 2023-01-sentiment-judging

2 stars 0 forks source link

Breeje - NO ZERO ADDRESS CHECKS FOR IMPORTANT DATA #2

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

Breeje

medium

NO ZERO ADDRESS CHECKS FOR IMPORTANT DATA

Summary

Not checking about the zero address before adding the address as important state variable.

Vulnerability Detail

Directly assigned the address passed from the constructor to state variable without any checks.

Impact

Adding zero address by mistake can result in loss.

Code Snippet

File: src/gmx/RewardRouterController.sol

30:     WETH.push(_WETH);

Link to code

File: src/gmx/RewardRouterV2Controller.sol

36:     sGLP.push(_SGLP);

Link to code

File: src/plutus/PLVGLPController.sol

39:     sGLP.push(_SGLP);
40:     PLVGLP.push(_PLVGLP);

Link to code

File: src/rage/DNGMXVaultController.sol

35:     vault.push(_vault);

Link to code

Tool used

Manual Review

Recommendation

Add a require statement to ensure that the address is not zero address.