Skip to content

Commit

Permalink
cgh: fix possible out of range on blockNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Nov 13, 2024
1 parent baa8a2b commit 32138d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/cli/server/api_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 32138d7

Please sign in to comment.