Skip to content

Commit

Permalink
fixed array out-of-bounds issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mllwchrry committed Jun 12, 2024
1 parent 41dd749 commit 22da214
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/mock/libs/data-structures/AvlTreeMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ contract AvlTreeMock {
bytes32[] memory keys_ = new bytes32[](_addressTree.size());
bytes32[] memory values_ = new bytes32[](keys_.length);

(keys_[0], values_[0]) = iterator_.value();
if (keys_.length != 0) {
(keys_[0], values_[0]) = iterator_.value();
}

uint256 index_ = 1;

Expand All @@ -206,7 +208,9 @@ contract AvlTreeMock {
bytes32[] memory keys_ = new bytes32[](_addressTree.size());
bytes32[] memory values_ = new bytes32[](keys_.length);

(keys_[0], values_[0]) = iterator_.value();
if (keys_.length != 0) {
(keys_[0], values_[0]) = iterator_.value();
}

uint256 index_ = 1;

Expand Down

0 comments on commit 22da214

Please sign in to comment.