mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
check message length
This commit is contained in:
parent
fe9ac10f02
commit
744e893dce
2 changed files with 12 additions and 3 deletions
|
@ -246,8 +246,16 @@ namespace client
|
|||
m_PayloadLen = bufbe32toh (m_Header + I2CP_HEADER_LENGTH_OFFSET);
|
||||
if (m_PayloadLen > 0)
|
||||
{
|
||||
m_Payload = new uint8_t[m_PayloadLen];
|
||||
ReceivePayload ();
|
||||
if (m_PayloadLen <= I2CP_MAX_MESSAGE_LENGTH)
|
||||
{
|
||||
m_Payload = new uint8_t[m_PayloadLen];
|
||||
ReceivePayload ();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogPrint (eLogError, "I2CP: Unexpected payload length ", m_PayloadLen);
|
||||
Terminate ();
|
||||
}
|
||||
}
|
||||
else // no following payload
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue