Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
2499b1b1
Unverified
Commit
2499b1b1
authored
7 years ago
by
Felix Lange
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rlp: fix string size check in readKind (#15625)
Issue found by @guidovranken
parent
e7610ead
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
raw.go
rlp/raw.go
+1
-1
raw_test.go
rlp/raw_test.go
+1
-0
No files found.
rlp/raw.go
View file @
2499b1b1
...
...
@@ -98,7 +98,7 @@ func readKind(buf []byte) (k Kind, tagsize, contentsize uint64, err error) {
tagsize
=
1
contentsize
=
uint64
(
b
-
0x80
)
// Reject strings that should've been single bytes.
if
contentsize
==
1
&&
buf
[
1
]
<
128
{
if
contentsize
==
1
&&
len
(
buf
)
>
1
&&
buf
[
1
]
<
128
{
return
0
,
0
,
0
,
ErrCanonSize
}
case
b
<
0xC0
:
...
...
This diff is collapsed.
Click to expand it.
rlp/raw_test.go
View file @
2499b1b1
...
...
@@ -96,6 +96,7 @@ func TestSplit(t *testing.T) {
{
input
:
"F90055"
,
err
:
ErrCanonSize
,
rest
:
"F90055"
},
{
input
:
"FA0002FFFF"
,
err
:
ErrCanonSize
,
rest
:
"FA0002FFFF"
},
{
input
:
"81"
,
err
:
ErrValueTooLarge
,
rest
:
"81"
},
{
input
:
"8501010101"
,
err
:
ErrValueTooLarge
,
rest
:
"8501010101"
},
{
input
:
"C60607080902"
,
err
:
ErrValueTooLarge
,
rest
:
"C60607080902"
},
...
...
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