mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
Update history_trienode.go
This commit is contained in:
parent
845009f684
commit
5b9d0e4f24
1 changed files with 3 additions and 0 deletions
|
|
@ -352,6 +352,9 @@ func decodeHeader(data []byte) (*trienodeMetadata, []common.Hash, []uint32, []ui
|
|||
// the specified offset.
|
||||
func decodeKeyEntry(keySection []byte, offset int) (uint64, uint64, []byte, int, error) {
|
||||
var byteRead int
|
||||
if offset < 0 || offset >= len(keySection) {
|
||||
return 0, 0, nil, 0, fmt.Errorf("key offset out of bounds, offset: %d, section size: %d", offset, len(keySection))
|
||||
}
|
||||
|
||||
// Resolve the length of shared key
|
||||
nShared, nn := binary.Uvarint(keySection[offset:]) // key length shared (varint)
|
||||
|
|
|
|||
Loading…
Reference in a new issue