mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
trie: correct off-by-one in embedded node size validation
This commit is contained in:
parent
c9b7ae422c
commit
0dd931bae2
1 changed files with 1 additions and 1 deletions
|
|
@ -225,7 +225,7 @@ func decodeRef(buf []byte) (node, []byte, error) {
|
|||
case kind == rlp.List:
|
||||
// 'embedded' node reference. The encoding must be smaller
|
||||
// than a hash in order to be valid.
|
||||
if size := len(buf) - len(rest); size > hashLen {
|
||||
if size := len(buf) - len(rest); size >= hashLen {
|
||||
err := fmt.Errorf("oversized embedded node (size is %d bytes, want size < %d)", size, hashLen)
|
||||
return nil, buf, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue