Skip to content

Commit

Permalink
- Check that MAX_OPS is not exceeded within push function
Browse files Browse the repository at this point in the history
  • Loading branch information
clowestab committed Dec 4, 2024
1 parent 34ec13f commit 9d2cdbe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contracts/GatewayFetcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ library GatewayFetcher {
n = 32 - n; // width w/o pad
r.addByte(GatewayOP.PUSH_0 + n);
bytes memory v = r.ops;
if (v.length + n > MAX_OPS) revert RequestOverflow();
assembly {
let len := mload(v)
mstore(add(add(v, 32), len), x) // append(x)
Expand Down

0 comments on commit 9d2cdbe

Please sign in to comment.