mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-31 04:44:13 +00:00
fixed crash
This commit is contained in:
parent
2f5967537a
commit
5e8dd82b6b
@ -570,8 +570,8 @@ namespace data
|
|||||||
key[l] = 0;
|
key[l] = 0;
|
||||||
LogPrint ("DatabaseLookup for ", key, " recieved");
|
LogPrint ("DatabaseLookup for ", key, " recieved");
|
||||||
uint8_t flag = buf[64];
|
uint8_t flag = buf[64];
|
||||||
|
uint8_t * excluded = buf + 65;
|
||||||
uint32_t replyTunnelID = 0;
|
uint32_t replyTunnelID = 0;
|
||||||
uint8_t * excluded = buf + 64;
|
|
||||||
if (flag & 0x01) //reply to tunnel
|
if (flag & 0x01) //reply to tunnel
|
||||||
{
|
{
|
||||||
replyTunnelID = be32toh (*(uint32_t *)(buf + 64));
|
replyTunnelID = be32toh (*(uint32_t *)(buf + 64));
|
||||||
@ -581,7 +581,7 @@ namespace data
|
|||||||
excluded += 2;
|
excluded += 2;
|
||||||
if (numExcluded > 512)
|
if (numExcluded > 512)
|
||||||
{
|
{
|
||||||
LogPrint ("Number of excluded peers exceeds 512");
|
LogPrint ("Number of excluded peers", numExcluded, " exceeds 512");
|
||||||
numExcluded = 0; // TODO:
|
numExcluded = 0; // TODO:
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,6 +591,10 @@ namespace data
|
|||||||
{
|
{
|
||||||
LogPrint ("Requested ", key, " found");
|
LogPrint ("Requested ", key, " found");
|
||||||
router->LoadBuffer ();
|
router->LoadBuffer ();
|
||||||
|
if (!router->GetBuffer ()) router = nullptr;
|
||||||
|
}
|
||||||
|
if (router)
|
||||||
|
{
|
||||||
replyMsg = CreateDatabaseStoreMsg (router);
|
replyMsg = CreateDatabaseStoreMsg (router);
|
||||||
excluded += numExcluded*32; // we don't care about exluded
|
excluded += numExcluded*32; // we don't care about exluded
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user