Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
b18e1f82
Commit
b18e1f82
authored
4 years ago
by
smartcontracts
Committed by
GitHub
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Stricter RLP boolean checking (#343)
Co-authored-by:
Maurelian
<
maurelian@protonmail.ch
>
parent
fb35aaef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
Lib_RLPReader.sol
...racts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol
+5
-0
Lib_RLPReader.test.json
...acts/test/data/json/libraries/rlp/Lib_RLPReader.test.json
+6
-0
No files found.
packages/contracts/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol
View file @
b18e1f82
...
...
@@ -353,6 +353,11 @@ library Lib_RLPReader {
out := byte(0, mload(ptr))
}
require(
out == 0 || out == 1,
"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1"
);
return out != 0;
}
...
...
This diff is collapsed.
Click to expand it.
packages/contracts/test/data/json/libraries/rlp/Lib_RLPReader.test.json
View file @
b18e1f82
...
...
@@ -16,6 +16,12 @@
"out"
:
[
false
]
},
"something other than 0 or 1 (should revert)"
:
{
"in"
:
[
"0x02"
],
"revert"
:
true
}
},
"readAddress"
:
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment