check if session is terminated before sending

This commit is contained in:
orignal 2018-12-04 16:10:52 -05:00
parent b57152cc25
commit 34dc6fbdc1

View File

@ -992,6 +992,11 @@ namespace transport
void NTCP2Session::EncryptAndSendNextBuffer (size_t payloadLen)
{
if (IsTerminated ())
{
delete[] m_NextSendBuffer; m_NextSendBuffer = nullptr;
return;
}
// encrypt
uint8_t nonce[12];
CreateNonce (m_SendSequenceNumber, nonce); m_SendSequenceNumber++;