-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: remediations #6
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,6 @@ | |
next = self.entries[next][account]; | ||
self.entries[current][account] = ZERO_ADDRESS; | ||
} | ||
self.entries[SENTINEL][account] = ZERO_ADDRESS; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: fixes I7 |
||
} | ||
|
||
function contains( | ||
|
@@ -146,7 +145,7 @@ | |
// Set correct size of returned array | ||
// solhint-disable-next-line no-inline-assembly | ||
/// @solidity memory-safe-assembly | ||
assembly { | ||
mstore(array, entryCount) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ | |
next = self.entries[next]; | ||
self.entries[current] = ZERO; | ||
} | ||
self.entries[SENTINEL] = ZERO; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: fixes I7 |
||
} | ||
|
||
function contains(LinkedBytes32 storage self, bytes32 entry) internal view returns (bool) { | ||
|
@@ -71,7 +70,7 @@ | |
view | ||
returns (bytes32[] memory array, bytes32 next) | ||
{ | ||
if (start != SENTINEL && contains(self, start)) revert LinkedList_InvalidEntry(start); | ||
if (start != SENTINEL && !contains(self, start)) revert LinkedList_InvalidEntry(start); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: fixes L6 |
||
if (pageSize == 0) revert LinkedList_InvalidPage(); | ||
// Init array with max page size | ||
array = new bytes32[](pageSize); | ||
|
@@ -98,13 +97,13 @@ | |
* incSENTINELrent page, nor will it be included in the next one if you pass it as a | ||
* start. | ||
*/ | ||
if (next != SENTINEL) { | ||
if (next != SENTINEL && entryCount > 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: fixes underflow bug previously fixed in other flavours of the lib |
||
next = array[entryCount - 1]; | ||
} | ||
// Set correct size of returned array | ||
// solhint-disable-next-line no-inline-assembly | ||
/// @solidity memory-safe-assembly | ||
assembly { | ||
mstore(array, entryCount) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: fixes I7