mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
cgh: fix possible out of range on blockNumber
This commit is contained in:
parent
baa8a2bb63
commit
32138d70ad
1 changed files with 3 additions and 0 deletions
|
|
@ -118,6 +118,9 @@ func getRpcBlockNumberFromString(blockNumber string) (rpc.BlockNumber, error) {
|
|||
if err != nil {
|
||||
return rpc.BlockNumber(0), errors.New("invalid block number")
|
||||
}
|
||||
if blckNum > uint64(^uint32(0)) {
|
||||
return rpc.BlockNumber(0), errors.New("block number out of range")
|
||||
}
|
||||
return rpc.BlockNumber(blckNum), nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue