From d3b423ba62438ab0e57f97f2bdf01e1158331dbe Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Wed, 7 Oct 2020 20:46:17 +0530 Subject: [PATCH] Added sanity checks in settle() token pools --- contracts/pools/erc20.sol | 1 + contracts/pools/eth.sol | 1 + 2 files changed, 2 insertions(+) diff --git a/contracts/pools/erc20.sol b/contracts/pools/erc20.sol index e813ed7..93b88c2 100644 --- a/contracts/pools/erc20.sol +++ b/contracts/pools/erc20.sol @@ -105,6 +105,7 @@ contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath { * @param _data array of connector's function calldata */ function settle(address[] calldata _targets, bytes[] calldata _data) external isChief { + require(_targets.length != 0, "targets-length-zero"); require(_targets.length == _data.length , "array-length-invalid"); require(registry.checkSettleLogics(address(this), _targets), "not-logic"); for (uint i = 0; i < _targets.length; i++) { diff --git a/contracts/pools/eth.sol b/contracts/pools/eth.sol index 143a69a..c52367f 100644 --- a/contracts/pools/eth.sol +++ b/contracts/pools/eth.sol @@ -102,6 +102,7 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath { * @param _data array of connector's function calldata */ function settle(address[] calldata _targets, bytes[] calldata _data) external isChief { + require(_targets.length != 0, "targets-length-zero"); require(_targets.length == _data.length , "array-length-invalid"); require(registry.checkSettleLogics(address(this), _targets), "not-logic"); for (uint i = 0; i < _targets.length; i++) {