mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 15:35:50 +00:00
Fix a bug that can cause a crash if a peer requests an empty node.
This commit is contained in:
@@ -149,10 +149,16 @@ bool SHAMap::getNodeFat(const SHAMapNode& wanted, std::vector<SHAMapNode>& nodeI
|
||||
SHAMapTreeNode::pointer node = getNode(wanted);
|
||||
if (!node)
|
||||
{
|
||||
cLog(lsWARNING) << "peer requested node that not in the map: " << wanted;
|
||||
cLog(lsWARNING) << "peer requested node that is not in the map: " << wanted;
|
||||
throw std::runtime_error("Peer requested node not in map");
|
||||
}
|
||||
|
||||
if (node->isEmpty())
|
||||
{
|
||||
cLog(lsWARNING) << "peer requests empty node";
|
||||
return false;
|
||||
}
|
||||
|
||||
nodeIDs.push_back(*node);
|
||||
Serializer s;
|
||||
node->addRaw(s, snfWIRE);
|
||||
|
||||
Reference in New Issue
Block a user