Skip to content

Commit

Permalink
fix out-of-boundary access in LCPUtils::readBytesUntil()
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele committed Nov 18, 2024
1 parent 54d2bac commit b7c7d33
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 b7c7d33

Please sign in to comment.