Skip to content

Commit

Permalink
Add length <32 check to child bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjimmutable committed Nov 5, 2023
1 parent 73b9139 commit dec0180
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/child/ChildERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ contract ChildERC20Bridge is
if (!Strings.equal(messageSourceChain, rootChain)) {
revert InvalidSourceChain();
}

if (!Strings.equal(sourceAddress, rootERC20BridgeAdaptor)) {
revert InvalidSourceAddress();
}
if (data.length == 0) {
if (data.length <= 32) {
// Data must always be greater than 32.
// 32 bytes for the signature, and at least some information for the payload
revert InvalidData();
}

Expand Down

0 comments on commit dec0180

Please sign in to comment.