Skip to content

Commit

Permalink
eth/api: fix potential nil deref in AccountRange (#21710)
Browse files Browse the repository at this point in the history
* Fix potential nil pointer error when neither block number nor hash is specified to accountRange

* Update error description
  • Loading branch information
aaronbuchwald committed Oct 20, 2020
1 parent 9d25f34 commit 3e82c9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eth/api.go
Expand Up @@ -389,6 +389,8 @@ func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, sta
if err != nil {
return state.IteratorDump{}, err
}
} else {
return state.IteratorDump{}, errors.New("either block number or block hash must be specified")
}

if maxResults > AccountRangeMaxResults || maxResults <= 0 {
Expand Down

0 comments on commit 3e82c9e

Please sign in to comment.