This commit is contained in:
ChadF 2024-04-14 13:44:37 +03:00 committed by GitHub
commit 3da9bbfdbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -394,6 +394,10 @@ namespace data
size_t LeaseSet2::ReadStandardLS2TypeSpecificPart (const uint8_t * buf, size_t len)
{
size_t offset = 0;
if(offset + 2 > len) // AKA (len < 2)
return 0;
// properties
uint16_t propertiesLen = bufbe16toh (buf + offset); offset += 2;
offset += propertiesLen; // skip for now. TODO: implement properties
@ -448,6 +452,10 @@ namespace data
size_t LeaseSet2::ReadMetaLS2TypeSpecificPart (const uint8_t * buf, size_t len)
{
size_t offset = 0;
if(offset + 2 > len) // AKA (len < 2)
return 0;
// properties
uint16_t propertiesLen = bufbe16toh (buf + offset); offset += 2;
offset += propertiesLen; // skip for now. TODO: implement properties

View file

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