mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix SHAMapTreeNode deserialization
This commit is contained in:
committed by
Vinnie Falco
parent
4dc573f195
commit
6a093b1b44
@@ -157,12 +157,11 @@ SHAMapAbstractNode::make(Blob const& rawNode, std::uint32_t seq, SHANodeFormat f
|
||||
for (int i = 0; i < (len / 33); ++i)
|
||||
{
|
||||
int pos;
|
||||
s.get8 (pos, 32 + (i * 33));
|
||||
|
||||
if ((pos < 0) || (pos >= 16)) throw std::runtime_error ("invalid CI node");
|
||||
|
||||
if (!s.get8 (pos, 32 + (i * 33)))
|
||||
throw std::runtime_error ("short CI node");
|
||||
if ((pos < 0) || (pos >= 16))
|
||||
throw std::runtime_error ("invalid CI node");
|
||||
s.get256 (ret->mHashes[pos], i * 33);
|
||||
|
||||
if (ret->mHashes[pos].isNonZero ())
|
||||
ret->mIsBranch |= (1 << pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user