code-423n4 / 2022-06-nested-findings

0 stars 1 forks source link

QA Report #72

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Add namesLength > 0 check in areOperatorsImported() method

function areOperatorsImported(bytes32[] calldata names, Operator[] calldata destinations)
    external
    view
    override
    returns (bool)
{
    uint256 namesLength = names.length;
    require(namesLength == destinations.length, "OR: INPUTS_LENGTH_MUST_MATCH");
    for (uint256 i = 0; i < namesLength; i++) {
        if (
            operators[names[i]].implementation != destinations[i].implementation ||
            operators[names[i]].selector != destinations[i].selector
        ) {
            return false;
        }
    }
    return true;
}

Recommendation

require(namesLength > 0 "empty names/destinations");