Browse Source

fixed incorrect lenght

pull/1221/head
orignal 6 years ago
parent
commit
5cc84133e3
  1. 4
      libi2pd/NTCP2.cpp

4
libi2pd/NTCP2.cpp

@ -648,14 +648,10 @@ namespace transport
else else
{ {
i2p::crypto::Siphash<8> (m_ReceiveIV, m_ReceiveIV, 8, m_ReceiveSipKey); i2p::crypto::Siphash<8> (m_ReceiveIV, m_ReceiveIV, 8, m_ReceiveSipKey);
uint16_t oldLen = m_NextReceivedLen;
m_NextReceivedLen = be16toh (m_NextReceivedLen ^ bufbe16toh(m_ReceiveIV)); m_NextReceivedLen = be16toh (m_NextReceivedLen ^ bufbe16toh(m_ReceiveIV));
LogPrint (eLogDebug, "NTCP2: received length ", m_NextReceivedLen); LogPrint (eLogDebug, "NTCP2: received length ", m_NextReceivedLen);
if (m_NextReceivedLen > oldLen)
{
delete[] m_NextReceivedBuffer; delete[] m_NextReceivedBuffer;
m_NextReceivedBuffer = new uint8_t[m_NextReceivedLen]; m_NextReceivedBuffer = new uint8_t[m_NextReceivedLen];
}
Receive (); Receive ();
} }
} }

Loading…
Cancel
Save