From b7c7d3367d29756d4485dc85a48a91dfaeaf4a4d Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Mon, 18 Nov 2024 23:33:20 +0900 Subject: [PATCH] fix out-of-boundary access in `LCPUtils::readBytesUntil()` Signed-off-by: Jun Kimura --- contracts/LCPUtils.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/LCPUtils.sol b/contracts/LCPUtils.sol index 6b85719..9692d59 100644 --- a/contracts/LCPUtils.sol +++ b/contracts/LCPUtils.sol @@ -17,7 +17,7 @@ library LCPUtils { pure returns (bytes memory bz, uint256 pos) { - pos = BytesUtils.find(src, offset, src.length, needle); + pos = BytesUtils.find(src, offset, src.length - offset, needle); if (pos == type(uint256).max) { revert LCPUtilsReadBytesUntilNotFound(); }