mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-18 23:36:39 +01:00
check for RI size
This commit is contained in:
parent
6ac846f95d
commit
56a95fa9b5
2 changed files with 8 additions and 3 deletions
|
@ -179,7 +179,7 @@ namespace data
|
||||||
void NetDb::AddRouterInfo (const uint8_t * buf, int len)
|
void NetDb::AddRouterInfo (const uint8_t * buf, int len)
|
||||||
{
|
{
|
||||||
IdentityEx identity;
|
IdentityEx identity;
|
||||||
identity.FromBuffer (buf, len);
|
if (identity.FromBuffer (buf, len))
|
||||||
AddRouterInfo (identity.GetIdentHash (), buf, len);
|
AddRouterInfo (identity.GetIdentHash (), buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,6 +240,11 @@ namespace data
|
||||||
localFileName[fileNameLength] = 0;
|
localFileName[fileNameLength] = 0;
|
||||||
s.seekg (extraFieldLength, std::ios::cur);
|
s.seekg (extraFieldLength, std::ios::cur);
|
||||||
LogPrint (eLogDebug, "Proccessing file ", localFileName, " ", compressedSize, " bytes");
|
LogPrint (eLogDebug, "Proccessing file ", localFileName, " ", compressedSize, " bytes");
|
||||||
|
if (!compressedSize)
|
||||||
|
{
|
||||||
|
LogPrint (eLogWarning, "Unexpected size 0. Skipped");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t * compressed = new uint8_t[compressedSize];
|
uint8_t * compressed = new uint8_t[compressedSize];
|
||||||
s.read ((char *)compressed, compressedSize);
|
s.read ((char *)compressed, compressedSize);
|
||||||
|
|
Loading…
Add table
Reference in a new issue