diff --git a/src/LibBytes.sol b/src/LibBytes.sol index dfbe288..657f507 100644 --- a/src/LibBytes.sol +++ b/src/LibBytes.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.15; library LibBytes { function keccak(bytes memory data, uint256 offset, uint256 length) internal pure returns (bytes32 result) { + require(offset + length <= data.length, "index out of bounds"); assembly { result := keccak256(add(data, add(32, offset)), length) }