Skip to content

Commit

Permalink
Merge pull request #23 from datachainlab/audit-202409-lcp-4
Browse files Browse the repository at this point in the history
LCP-4: Fix out-of-boundary access in `LCPUtils::readBytesUntil()`

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Nov 18, 2024
2 parents 54d2bac + b7c7d33 commit e073fa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/LCPUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit e073fa3

Please sign in to comment.