mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
check I2NP message buffer size
This commit is contained in:
parent
a26c5f85c3
commit
ff48422ec0
4 changed files with 29 additions and 25 deletions
|
@ -152,8 +152,8 @@ namespace tunnel
|
|||
*newMsg = *(msg.data);
|
||||
msg.data = newMsg;
|
||||
}
|
||||
memcpy (msg.data->buf + msg.data->len, fragment, size); // concatenate fragment
|
||||
msg.data->len += size;
|
||||
if (msg.data->Concat (fragment, size) < size) // concatenate fragment
|
||||
LogPrint (eLogError, "Tunnel endpoint I2NP buffer overflow ", msg.data->maxLen);
|
||||
if (isLastFragment)
|
||||
{
|
||||
// message complete
|
||||
|
@ -208,8 +208,8 @@ namespace tunnel
|
|||
*newMsg = *(msg.data);
|
||||
msg.data = newMsg;
|
||||
}
|
||||
memcpy (msg.data->buf + msg.data->len, it->second.data->GetBuffer (), size); // concatenate out-of-sync fragment
|
||||
msg.data->len += size;
|
||||
if (msg.data->Concat (it->second.data->GetBuffer (), size) < size) // concatenate out-of-sync fragment
|
||||
LogPrint (eLogError, "Tunnel endpoint I2NP buffer overflow ", msg.data->maxLen);
|
||||
if (it->second.isLastFragment)
|
||||
{
|
||||
// message complete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue