diff --git a/libi2pd/SSU2Session.cpp b/libi2pd/SSU2Session.cpp index 8a642384..87181da6 100644 --- a/libi2pd/SSU2Session.cpp +++ b/libi2pd/SSU2Session.cpp @@ -310,6 +310,11 @@ namespace transport while (!m_SendQueue.empty () && m_SentPackets.size () <= m_WindowSize) { auto msg = m_SendQueue.front (); + if (!msg) + { + m_SendQueue.pop_front (); + continue; + } size_t len = msg->GetNTCP2Length () + 3; if (len > m_MaxPayloadSize) // message too long { @@ -376,6 +381,7 @@ namespace transport bool SSU2Session::SendFragmentedMessage (std::shared_ptr msg) { + if (!msg) return false; size_t lastFragmentSize = (msg->GetNTCP2Length () + 3 - m_MaxPayloadSize) % (m_MaxPayloadSize - 8); size_t extraSize = m_MaxPayloadSize - lastFragmentSize; bool ackBlockSent = false;