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
a3e35414
Unverified
Commit
a3e35414
authored
Aug 16, 2023
by
lightclient
Committed by
GitHub
Aug 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/types: fix unmarshalling of BlobTx values (#27939)
FromBig returns true *when overflow occurs*
parent
386cba15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
transaction_marshalling.go
core/types/transaction_marshalling.go
+7
-7
No files found.
core/types/transaction_marshalling.go
View file @
a3e35414
...
...
@@ -373,20 +373,20 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
itx
.
BlobHashes
=
dec
.
BlobVersionedHashes
// signature R
var
o
k
bool
var
o
verflow
bool
if
dec
.
R
==
nil
{
return
errors
.
New
(
"missing required field 'r' in transaction"
)
}
itx
.
R
,
o
k
=
uint256
.
FromBig
((
*
big
.
Int
)(
dec
.
R
))
if
!
ok
{
itx
.
R
,
o
verflow
=
uint256
.
FromBig
((
*
big
.
Int
)(
dec
.
R
))
if
overflow
{
return
errors
.
New
(
"'r' value overflows uint256"
)
}
// signature S
if
dec
.
S
==
nil
{
return
errors
.
New
(
"missing required field 's' in transaction"
)
}
itx
.
S
,
o
k
=
uint256
.
FromBig
((
*
big
.
Int
)(
dec
.
S
))
if
!
ok
{
itx
.
S
,
o
verflow
=
uint256
.
FromBig
((
*
big
.
Int
)(
dec
.
S
))
if
overflow
{
return
errors
.
New
(
"'s' value overflows uint256"
)
}
// signature V
...
...
@@ -394,8 +394,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
if
err
!=
nil
{
return
err
}
itx
.
V
,
o
k
=
uint256
.
FromBig
(
vbig
)
if
!
ok
{
itx
.
V
,
o
verflow
=
uint256
.
FromBig
(
vbig
)
if
overflow
{
return
errors
.
New
(
"'v' value overflows uint256"
)
}
if
itx
.
V
.
Sign
()
!=
0
||
itx
.
R
.
Sign
()
!=
0
||
itx
.
S
.
Sign
()
!=
0
{
...
...
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