Browse Source

check for RI size

pull/117/head
orignal 10 years ago
parent
commit
56a95fa9b5
  1. 2
      NetDb.cpp
  2. 5
      Reseed.cpp

2
NetDb.cpp

@ -179,7 +179,7 @@ namespace data @@ -179,7 +179,7 @@ namespace data
void NetDb::AddRouterInfo (const uint8_t * buf, int len)
{
IdentityEx identity;
identity.FromBuffer (buf, len);
if (identity.FromBuffer (buf, len))
AddRouterInfo (identity.GetIdentHash (), buf, len);
}

5
Reseed.cpp

@ -240,6 +240,11 @@ namespace data @@ -240,6 +240,11 @@ namespace data
localFileName[fileNameLength] = 0;
s.seekg (extraFieldLength, std::ios::cur);
LogPrint (eLogDebug, "Proccessing file ", localFileName, " ", compressedSize, " bytes");
if (!compressedSize)
{
LogPrint (eLogWarning, "Unexpected size 0. Skipped");
continue;
}
uint8_t * compressed = new uint8_t[compressedSize];
s.read ((char *)compressed, compressedSize);

Loading…
Cancel
Save