We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While covering libs with test in the core repo, I stumbled upon some wired behavior of the contracts/0.4.24/lib/Packed64x4.sol's set function.
core
contracts/0.4.24/lib/Packed64x4.sol
set
Passing an invalid n (n > 3) in the set function can lead to unexpected behavior.
n
set(4,5)
get(0)
5
Error occurred: invalid opcode
There are no invalid usages inside the current codebase, so no worries 😉
But it is better not to use this library in new contracts as is. Or at least add a require(n < 4, "OFFSET_OUT_OF_RANGE"); check to the set function.
require(n < 4, "OFFSET_OUT_OF_RANGE");
The text was updated successfully, but these errors were encountered:
@tamtamchik @TheDZhon I'm working on this issue. Could you assign it to me.
Sorry, something went wrong.
No branches or pull requests
While covering libs with test in the
core
repo, I stumbled upon some wired behavior of thecontracts/0.4.24/lib/Packed64x4.sol
'sset
function.Passing an invalid
n
(n > 3) in theset
function can lead to unexpected behavior.set(4,5)
leads to rewriting value for the first spot, so callingget(0)
returns5
instead of the original value.Error occurred: invalid opcode
There are no invalid usages inside the current codebase, so no worries 😉
But it is better not to use this library in new contracts as is.
Or at least add a
require(n < 4, "OFFSET_OUT_OF_RANGE");
check to theset
function.The text was updated successfully, but these errors were encountered: