Added bounds checking to NetDb::HandleDatabaseSearchReplyMsg().

This commit is contained in:
Chad Fraleigh 2023-07-05 15:51:47 -07:00
parent c1ede68a33
commit e8b4e971f9
No known key found for this signature in database
GPG key ID: 2415C39758458A8F

View file

@ -952,6 +952,10 @@ namespace data
else if(!m_FloodfillBootstrap) else if(!m_FloodfillBootstrap)
LogPrint (eLogWarning, "NetDb: Requested destination for ", key, " not found"); LogPrint (eLogWarning, "NetDb: Requested destination for ", key, " not found");
// All peers hashs in buffer?
if(msg->GetPayloadLength() < (size_t) (33 + num * IDENTITY_HASH_SIZE))
return;
// try responses // try responses
for (int i = 0; i < num; i++) for (int i = 0; i < num; i++)
{ {