Skip to content

Conversation

maradini77
Copy link

Changes

  • Fixed boundary calculation in bytesToBytes32() function
  • Added safety check to prevent reading beyond b.length when offset > 0
  • Improved robustness of storage slot analysis during test execution

Problem

The previous implementation calculated max without considering the offset parameter:

uint256 max = b.length > 32 ? 32 : b.length; // Ignores offset

This could cause b[offset + i] to access beyond array boundaries, leading to reverts during legitimate test scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant