<!-- canonical: https://0xsimao.com/findings/ostium-empty-watchlist-keeper-handled -->

# In OstiumLinkUpKeep, empty watchlist or keeperIds arguments are not handled

Low/Info · Three Sigma · RWA perpetuals DEX · 19th February, 2024

Finding 3S-OS-L15 of the Ostium security review.

- Protocol: https://www.ostium.com/
- Report: /reports/ostium
- Source: https://cdn.sanity.io/files/qoqld077/production/a95b9c69e0f65d1d6b0e649f0d62a362358ca8ce.pdf

---

### Description

In OstiumLinkUpKeep, functions [setWatchList()](https://github.com/0xOstium/smart-contracts-threeSigma/blob/dev/src/OstiumLinkUpKeep.sol#L131), [addToWatchList()](https://github.com/0xOstium/smart-contracts-threeSigma/blob/dev/src/OstiumLinkUpKeep.sol#L142) and
[removeFromWatchList()](https://github.com/0xOstium/smart-contracts-threeSigma/blob/dev/src/OstiumLinkUpKeep.sol#L153) don't handle 0 length array inputs, which could lead to incorrect
state.

### Recommendation

Explicitly check for empty arrays.

### Status

Addressed in [#c9ebe98](https://github.com/0xOstium/smart-contracts-threeSigma/pull/58/commits/c9ebe98d766cd8c8adf6477f59d6c745642cba72).
