From 07aefb98c306811c32932b08c8c23a858fabee7e Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Tue, 20 Oct 2020 14:19:21 -0400 Subject: [PATCH] eth/api: fix potential nil deref in AccountRange (#21710) * Fix potential nil pointer error when neither block number nor hash is specified to accountRange * Update error description # Conflicts: # eth/api.go --- eth/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/eth/api.go b/eth/api.go index ee66e9371..56af61c73 100644 --- a/eth/api.go +++ b/eth/api.go @@ -366,6 +366,7 @@ func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, sta if block == nil { return state.IteratorDump{}, fmt.Errorf("block %s not found", hash.Hex()) } + } else { blockNumber = block.NumberU64() }